langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
8
Task/Here-document/UNIX-Shell/here-document-1.sh
Normal file
8
Task/Here-document/UNIX-Shell/here-document-1.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
cat << ANARBITRARYTOKEN
|
||||
The river was deep but I swam it, Janet.
|
||||
The future is ours so let's plan it, Janet.
|
||||
So please don't tell me to can it, Janet.
|
||||
I've one thing to say and that's ...
|
||||
Dammit. Janet, I love you.
|
||||
ANARBITRARYTOKEN
|
||||
6
Task/Here-document/UNIX-Shell/here-document-2.sh
Normal file
6
Task/Here-document/UNIX-Shell/here-document-2.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
cat << EOF
|
||||
Here documents do parameter and command substitution:
|
||||
* Your HOME is $HOME
|
||||
* 2 + 2 is `expr 2 + 2`
|
||||
* Backslash quotes a literal \$, \` or \\
|
||||
EOF
|
||||
5
Task/Here-document/UNIX-Shell/here-document-3.sh
Normal file
5
Task/Here-document/UNIX-Shell/here-document-3.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
if true; then
|
||||
cat <<- EOF
|
||||
The <<- variant deletes any tabs from start of each line.
|
||||
EOF
|
||||
fi
|
||||
6
Task/Here-document/UNIX-Shell/here-document-4.sh
Normal file
6
Task/Here-document/UNIX-Shell/here-document-4.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
cat << 'TOKEN'
|
||||
If TOKEN has any quoted characters (like 'TOKEN', "TOKEN" or \TOKEN),
|
||||
then all $ ` \ in the here document are literal characters.
|
||||
|
||||
$PATH \$PATH `shutdown now`
|
||||
TOKEN
|
||||
9
Task/Here-document/UNIX-Shell/here-document-5.sh
Normal file
9
Task/Here-document/UNIX-Shell/here-document-5.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/csh -f
|
||||
cat << ANARBITRARYTOKEN
|
||||
* Your HOME is $HOME
|
||||
* 2 + 2 is `@ n = 2 + 2; echo \$n`
|
||||
ANARBITRARYTOKEN
|
||||
|
||||
cat << 'ANARBITRARYTOKEN'
|
||||
$PATH \$PATH `shutdown now`
|
||||
'ANARBITRARYTOKEN'
|
||||
Loading…
Add table
Add a link
Reference in a new issue