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

You should use dollar-star and printf to prevent echo treating some of the arguments as flags:

    printf '%s\n' "$*"
Which works while

    echo "$@"
might not work as expected if you did e.g.:

    notes -n is a bad flag to pass to some commands
The latest posix bans echo from taking any - options, so you may be safe with /bin/echo or if your shebang specifies "sh" but that hasn't percolated down everywhere yet.



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

Search: