Hacker News new | past | comments | ask | show | jobs | submit login

Thanks - I wasn't aware that echo was that problematic as I target bash (usually v4 and above) from my scripts.

I just tested it out with:

  sh /bin/echo -n "test"
  /bin/echo: 3: Syntax error: "(" unexpected
I didn't realise until recently that printf can also replace a lot of uses of the "date" command which is helpful with logging as it avoids calling an external command for every line logged.



> printf can also replace a lot of uses of the "date" command

Very cool (but bash-specific). Manual: https://www.gnu.org/software/bash/manual/bash.html#index-pri...

> sh /bin/echo -n "test"

This is gibberish -- it's trying to execute /bin/echo as if it was a shell script. Maybe you meant:

  sh -c '/bin/echo -n "test"'




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: