Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
lozf
on Jan 6, 2021
|
parent
|
context
|
favorite
| on:
GNU Units
Same here back in the early aughts, but it took me a while to really dig in and discover that units also handles times too.
e.g. units "sec $(echo $SECONDS)" "day;hr;min;sec"
philjackson
on Jan 6, 2021
[–]
Useless use of echo there.
x0
on Jan 6, 2021
|
parent
|
next
[–]
It's very important to watch out for useless uses of echo/cat. What is cat, a few megabytes now? Fine for those of us on modern hardware, but you never know what PDP-11 user is going to copy paste your comment into their terminal.
ttul
on Jan 6, 2021
|
parent
|
prev
|
next
[–]
Not unless you’re also trying to demonstrate the magic of fork.
techbio
on Jan 6, 2021
|
parent
|
prev
|
next
[–]
Extraneously strenuous use of "useless" when using "redundant" would have done...unless useless has another usage.
EDIT: The commenter echoed, duckly.
watersb
on Jan 7, 2021
|
parent
|
prev
|
next
[–]
I use a construct like this to ensure that the value ends with a newline.
smorrow
on Jan 7, 2021
|
root
|
parent
|
next
[–]
$() chomps the newline though...
lozf
on Jan 6, 2021
|
parent
|
prev
[–]
noted, thanks
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
e.g. units "sec $(echo $SECONDS)" "day;hr;min;sec"