Code backup
This commit is contained in:
2026-05-10 16:59:01 +02:00
commit 368d6fafea
796 changed files with 315310 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
String='pippo' # Zero-length ("null") string variable.
if [ -z "$String" ]
then
echo "\$String is null."
else
echo "\$String is NOT null."
fi # $String is null.
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
count=0
while [ $count -le 10 ]
do
echo "$count"
count=$(( $count + 1 ))
done
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
ping -c1 -W1 -q $server &>/dev/null
#status=$( echo $? )
if [[ $? == 0 ]] ; then
#Connection success!
else
#Connection failure
fi
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
source repo.sh
echo Welcome ${USERNAME}!
echo Your email is ${EMAIL}.
echo prova $COMPUTER Funzione
Funzione
echo test $COMPUTER
+6
View File
@@ -0,0 +1,6 @@
USERNAME="satish"
EMAIL="satish@linuxconcept.com"
Funzione() {
COMPUTER="=PC000"
}
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
EnableDisable() {
case $1 in
1) local stateED="On";;
2) local stateED="Off";;
esac
echo $stateED
}
printf "%s\t%s\t%s\n" "Status:" "$(EnableDisable 1)" "Test On"
printf "%s\t%s\t%s\n" "Status:" "$(EnableDisable 2)" "Test Off"
+53
View File
@@ -0,0 +1,53 @@
Main (){
if [ ! -z $A ];then
RES="${A}"
fi
if [ ! -z $B ];then
RES+=":${B}"
fi
if [ ! -z $C ];then
RES+="\\${C}"
fi
if [ ! -z $D ];then
RES+="//${D}"
fi
echo $RES
}
while test -n "$1"; do
case "$1" in
--protocol | -p)
PROTOCOL=$2
shift ;;
--a )
A=$2
shift;;
--b )
B=$2
shift;;
--c )
C=$2
shift;;
--d )
D=$2
shift;;
*)
echo "Unknown argument: $1"
exit $STATE_UNK ;;
esac
shift
done
Main