fix small typo

pass -e flag to echo to interpret escape characters correctly
This commit is contained in:
lemonez 2020-04-16 17:37:30 -07:00 committed by GitHub
parent ecca2c3837
commit fb76c0b7fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,7 +225,9 @@ cat file.txt
# We can also read the file using `cat`: # We can also read the file using `cat`:
Contents=$(cat file.txt) Contents=$(cat file.txt)
echo "START OF FILE\n$Contents\nEND OF FILE" # "\n" prints a new line character # "\n" prints a new line character
# "-e" to interpret the newline escape characters as escape characters
echo -e "START OF FILE\n$Contents\nEND OF FILE"
# => START OF FILE # => START OF FILE
# => [contents of file.txt] # => [contents of file.txt]
# => END OF FILE # => END OF FILE