Skip to content

Instantly share code, notes, and snippets.

@isaacs
Last active October 23, 2018 21:57
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 isaacs/737caf29f83de34b9f3aedbdcbf236e4 to your computer and use it in GitHub Desktop.
Save isaacs/737caf29f83de34b9f3aedbdcbf236e4 to your computer and use it in GitHub Desktop.
#!/bin/bash
ifs="$IFS"
IFS='\n\t'
cmd="echo $@"
bash -c "$cmd"
#!/bin/bash
ifs="$IFS"
IFS='\n\t'
cmd="echo "'"'"$@"'"'
bash -c "$cmd"
@isaacs
Copy link
Author

isaacs commented Oct 23, 2018

$ bash3 newlines.sh 'a
> b'
a
bash: line 1: b: command not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment