mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-03 19:45:38 +03:00
fix small typo
pass -e flag to echo to interpret escape characters correctly
This commit is contained in:
parent
ecca2c3837
commit
fb76c0b7fe
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user