Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
scott_karana
on March 30, 2017
|
parent
|
context
|
favorite
| on:
Explain Shell
file=$(echo `basename "$file"`)
This is a horrible example, since it has a "useless use of echo", forcing nested evaluations and a bashism. Basename prints to stdout too!
The sh-compatible, simpler equivalent:
file=`basename "$file"`
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
The sh-compatible, simpler equivalent: