Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 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
|
||||
8
Task/Here-document/UNIX-Shell/here-document-5.sh
Normal file
8
Task/Here-document/UNIX-Shell/here-document-5.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
echo '
|
||||
In any unix shell, you specify a text block and can use all whitespace like
|
||||
(spaces) & (tab) in it, by using single quotes.
|
||||
As mentioned above, a Unix "here document" is a type of redirection.
|
||||
In a literal Bash here document, the starting token must be
|
||||
quoted, but the end token must not, so they are not the same, which does not
|
||||
conform to the task definition.
|
||||
'
|
||||
Loading…
Add table
Add a link
Reference in a new issue