Code:
#!/bin/bash var1=$(nc -dvzw5 thebes.openshells.net 22) var2='Connection to thebes.openshells.net 22 port [tcp/ssh] succeeded!' if [ "$var1" = "$var2" ]; then echo TRUE else echo FALSE fi
#!/bin/bash var1=$(nc -dvzw5 thebes.openshells.net 22) var2='Connection to thebes.openshells.net 22 port [tcp/ssh] succeeded!' if [ "$var1" = "$var2" ]; then echo TRUE else echo FALSE fi
#!/bin/bash echo "Students name" echo -n "Enter student's name: " read name echo case $name in Example1|Math) echo "C" ;; Example2|Programming) echo "D" ;; Example3|WWW) echo "A" ;; Example4|Economie) echo "-" ;; esac
PREFIX=192.168.1 OCTET=1 while [ $OCTET -lt "255" ]; do echo -en "Pinging ${PREFIX}.${OCTET}..." ping -c1 -w1 ${PREFIX}.${OCTET} > /dev/null 2>&1 if [ "$?" -eq "0" ]; then echo "OK" else echo "Failed" fi let OCTET=$OCTET+1 done
let $OCTET=$OCTET+1
#!/bin/bash # Write error message on stderr and die function die() { echo "$@" >&2 exit 1 } # Load var from properties files function load() { for propertie in "$@" ; do [[ -f "${propertie}" ]] || die "load() : \"${propertie}\" don't exist !" while read ; do echo "${REPLY%=*}" echo "${REPLY#*=}" [[ -n "${REPLY%%=*}" && -z "${REPLY#*=}" ]] || die "load() : Variable \"${REPLY%%=*}\" is empty!" eval "${REPLY%%=*}"=\'"${REPLY#*=}"\' done < "${propertie}" done } load "manage_srcds.conf" echo "SRCDS_TICKRATE=$SRCDS_TICKRATE" echo "SRCDS_SCREEN=$SRCDS_SCREEN" echo "SRCDS_SRCDS_GAME_NAME=$SRCDS_GAME_NAME" echo "SRCDS_MAXPLAYERS=$SRCDS_MAXPLAYERS"
function Return { echo $1 } case "$1" in "" ) echo "give parameters please";; [0-9]* ) echo "No numbers please";; * ) Return;;
#!/bin/bash # This line works as expected.... echo "the user is <$USER> and the hostname is <$HOSTNAME>" MYVAR1=bill MYVAR2=fred # This lines doesn't..... echo "my first variable is<$MYVAR1> and my second is <$MYVAR2>"
<?xml version="1.0" encoding="UTF-8"?> <channel name="xfce4-power-manager" version="1.0"> <property name="xfce4-power-manager" type="empty"> <property name="power-button-action" type="empty"/> <property name="show-tray-icon" type="empty"/> <property name="logind-handle-lid-switch" type="bool" value="true"/> <property name="dpms-on-ac-sleep" type="uint" value="1"/> <property name="dpms-on-ac-off" type="uint" value="2"/> <property name="brightness-on-battery" type="uint" value="9"/> <property name="dpms-on-battery-sleep" type="uint" value="1"/> <property name="dpms-on-battery-off" type="uint" value="2"/> <property name="lock-screen-suspend-hibernate" type="bool" value="false"/> <property name="dpms-enabled" type="bool" value="true"/> </property> </channel>
echo "" >>$LOG_DIR/$LOG_NAME echo "" >>$LOG_DIR/$LOG_NAME echo "" >>$LOG_DIR/$LOG_NAME echo "" >>$LOG_DIR/$LOG_NAME print "***************** LEVEL 2: Truncating Tables: Success: tables Truncated ***********************" >> $LOG/$LOG_NAME echo "" >>$LOG_DIR/$LOG_NAME echo "" >>$LOG_DIR/$LOG_NAME echo "" >>$LOG_DIR/$LOG_NAME echo "" >>$LOG_DIR/$LOG_NAME # Run the load scripts. echo "***************** LEVEL 3: Loading Dupe Check Tables: Success: Dupe Check tables Loaded***********************" >> $LOG/$LOG_NAME