Skip to content

Instantly share code, notes, and snippets.

@solarkraft
Created February 23, 2023 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save solarkraft/0b8974d5c19d5563d0bfa1c3d3c04103 to your computer and use it in GitHub Desktop.
Save solarkraft/0b8974d5c19d5563d0bfa1c3d3c04103 to your computer and use it in GitHub Desktop.
Shell scripting is awesome
#!/usr/bin/env sh
addstuff=y; true && echo "a b$([ $addstuff = "y" ] && echo \" c\")"
# a b" c"
addstuff=y; stufftoadd=" c d"; true && echo a b$([ $addstuff = "y" ] && echo $stufftoadd)
# a bc d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment