Last active
October 17, 2018 04:39
-
-
Save jeamland/a1cb517203077815bd84fde919c6b411 to your computer and use it in GitHub Desktop.
fish vs bash
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
# Necessary establishing information... | |
fish$ fish --version | |
fish, version 2.7.1 | |
# Let's create a file that contains newlines. | |
fish$ cat > testfile.txt | |
foo | |
bar | |
# fish uses (command) to put stuff on the command line | |
fish$ echo (cat testfile.txt) | |
foo bar | |
# Hmm. We've lost the newlines. I wonder what bash does. | |
fish$ bash | |
bash$ bash --version | |
$ bash --version | |
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) | |
Copyright (C) 2007 Free Software Foundation, Inc. | |
bash$ echo $(cat testfile.txt) | |
foo bar | |
# Well that's the same, what about with quotes? | |
bash$ echo "$(cat testfile.txt)" | |
foo | |
bar | |
# Ah ha! Let's try that in fish! | |
bash$ exit | |
fish$ echo "(cat testfile.txt)" | |
(cat testfile.txt) | |
# Darn. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment