mirror of
https://github.com/danog/learn-bash.git
synced 2024-11-30 04:19:06 +01:00
Update learn.sh
This commit is contained in:
parent
a983bbf39e
commit
dde8a84262
5
learn.sh
5
learn.sh
@ -146,7 +146,6 @@ Your selection (number, c to continue): "
|
|||||||
[ "$editor" = "1" ] && learn_nano
|
[ "$editor" = "1" ] && learn_nano
|
||||||
[ "$editor" = "2" ] && learn_vi
|
[ "$editor" = "2" ] && learn_vi
|
||||||
done
|
done
|
||||||
set +H
|
|
||||||
|
|
||||||
echo "Sublesson 3: echo.
|
echo "Sublesson 3: echo.
|
||||||
Echo is one of the basic tools that are most commonly used in bash scripting: it prints out a message to the user. This very message is printed using echo.
|
Echo is one of the basic tools that are most commonly used in bash scripting: it prints out a message to the user. This very message is printed using echo.
|
||||||
@ -178,9 +177,13 @@ Will print:
|
|||||||
`echo This will print \\\"echo \\\` it works! \\\` \\\\ \\\"`
|
`echo This will print \\\"echo \\\` it works! \\\` \\\\ \\\"`
|
||||||
"
|
"
|
||||||
press
|
press
|
||||||
|
echo 'If your phrase also includes a ! followed by a letter or number you should enclose the enclose the phrase in single quotes (\').'
|
||||||
|
press
|
||||||
echo "To create a file using echo the usage is also very simple:
|
echo "To create a file using echo the usage is also very simple:
|
||||||
echo \"This and
|
echo \"This and
|
||||||
this text will go to a text file.\" > file.txt
|
this text will go to a text file.\" > file.txt
|
||||||
|
This will recreate the file.
|
||||||
|
To append the text, insert two >> instead of 1 >
|
||||||
|
|
||||||
Of course, you can easily change the extension from txt to sh to create a shell script (just don't forget the shebang).
|
Of course, you can easily change the extension from txt to sh to create a shell script (just don't forget the shebang).
|
||||||
"
|
"
|
||||||
|
Loading…
Reference in New Issue
Block a user