Created
November 6, 2021 06:47
-
-
Save kennyyu/a727cb12207b501f83bfa07429c5480b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
CONTENTS=$(cat <<EOF | |
foo | |
bar | |
baz | |
EOF | |
) | |
sudo echo "$CONTENTS" > /tmp/my_file.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ /tmp/foobar.sh
++ cat
bar
baz'
bar
baz'
$ cat /tmp/my_file.txt
foo
bar
baz