Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
3
Task/Loops-Foreach/UNIX-Shell/loops-foreach-1.sh
Normal file
3
Task/Loops-Foreach/UNIX-Shell/loops-foreach-1.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for file in *.sh; do
|
||||
echo "filename is $file"
|
||||
done
|
||||
8
Task/Loops-Foreach/UNIX-Shell/loops-foreach-2.sh
Normal file
8
Task/Loops-Foreach/UNIX-Shell/loops-foreach-2.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin
|
||||
|
||||
oldifs=$IFS
|
||||
IFS=:
|
||||
for dir in $PATH; do
|
||||
echo search $dir
|
||||
done
|
||||
IFS=$oldifs
|
||||
4
Task/Loops-Foreach/UNIX-Shell/loops-foreach-3.sh
Normal file
4
Task/Loops-Foreach/UNIX-Shell/loops-foreach-3.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
collection=("first" "second" "third" "fourth" "something else")
|
||||
for x in "${collection[@]}"; do
|
||||
echo "$x"
|
||||
done
|
||||
4
Task/Loops-Foreach/UNIX-Shell/loops-foreach-4.sh
Normal file
4
Task/Loops-Foreach/UNIX-Shell/loops-foreach-4.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
set -A collection "first" "second" "third" "fourth" "something else"
|
||||
for x in "${collection[@]}"; do
|
||||
echo "$x"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue