diff --git a/4.html b/4.html
index 60d9188..005a580 100644
--- a/4.html
+++ b/4.html
@@ -29,6 +29,10 @@
document.getElementsByTagName( 'head' )[0].appendChild( link );
+
+
@@ -196,6 +200,24 @@ USER Benutzername
+ https://www.schubertdaniel.de/linuxkurs
+ https://git.scytec.de/danthefan/linuxkurs/raw/master/beispiele/mysystem.sh
Der Kontext aller Script Variablen ist der der sub-shell
Kommando Verkettung https://linuxconfig.org/bash-scripting-tutorial
+
+
+
+ export PATH=$PATH:/pfad/zum/script
~/bin/
-> diesen zur $PATH
dazuGentlemen, open your Editor!
+
-
- https://git.scytec.de/danthefan/linuxkurs/raw/master/beispiele/mysystem.sh
+ #!/bin/bash
@@ -218,8 +240,8 @@ uptime
MSG="\nDas ist alles! Bye, $USER! \n\n"
printf "${MSG}"
-
-
-
- export PATH=$PATH:/pfad/zum/script
~/bin/
-> diesen zur $PATH
dazu
+ Hinweis: tar -czf .....
+
-
+ #!/bin/bash
+tar -czf myhome_directory.tar.gz /home/$USER
+mkdir archiv
+mv myhome_directory.tar.gz archiv/
+
+
Kontrollstrukturen
+ if then
+
+
#!/bin/bash
+cd
+ls
+if [ -e sample.sh ]
+then
+ echo "file exists!"
+else
+ echo "file does not exist"
+fi
if then elif
+
+
#!/bin/bash
+ cd
+ls -l
+read -p "Enter a file name: " filename
+if [ -e $filename ]
+then
+ echo "file exists!"
+ if [ -r $filename ]
+ then
+ status="readable "
+ fi
+ if [ -w $filename ]
+ then
+ status=$status"writable "
+ fi
+ if [ -x $filename ]
+ then
+ status=$status"executable"
+ fi
+ echo "file permission: "$status
+else
+ echo "file does not exist"
+fi
for loop
+
+
#!/bin/bash
+for f in {1..9}
+do
+ touch "$f xx.txt"
+done
case
+
+
#!/bin/bash
+ clear
+ read -p "Integer1: " int1
+ read -p "Integer2: " int2
+ printf "Menu: \n[a] Addition\n[b]Subtraction\n[c]Multiplication\n[d]Division\n"
+ echo "======================"
+ read -p "Your choice: " choice
+ res=0
+ case $choice in
+ a)
+ res=$((int1+int2))
+ ;;
+ b)
+ res=$((int1-int2))
+ ;;
+ c)
+ res=$((int1*int2))
+ ;;
+ d)
+ res=$((int1/int2))
+ ;;
+ *)
+ echo "Invalid input"
+ esac
+ echo "The result is: " $res
while loop
+
+
#!/bin/bash
+x=1
+while [ $x -le 5 ]
+do
+ echo "Welcome $x times"
+ x=$(( $x + 1 ))
+done
until loop
+
+
#!/bin/bash
+i=1
+until [ $i -gt 6 ]
+do
+ echo "Welcome $i times."
+ i=$(( i+1 ))
+done
while vs until
+
+
+