Hacker News new | ask | show | jobs
by semanticist 5594 days ago
I prefer (cd /path && command), since that way if the cd fails for some reason (like you've typo'd the path), it won't still attempt to run the command.
1 comments

Of course! I actually do always use double-ampersand for chaining commands in bash, not sure what made me use a semicolon in that example. Thanks for the correction, a small but important distinction.