sleepid.sh exit 1 read -p $@ $0
cat sleeppid.sh
#!/bin/bash
echo Hello
echo "Staring script $0"
USER=$2
fruits=$@
HOST=$1
T=test.file
if [ -e $T ]
then
echo $T exists
else
echo file not exists
fi
read -p "Enter the country" country
for COLOR in "${fruits}" #start from 2nd element
do
echo "Color: $COLOR"
done
ping -c 1 $HOST
if [ "$?" -ne "0" ]
then
echo $HOST unreachable
exit 1
else
echo $HOST is reachable
fi
echo "User $USER, country $country"
echo PID is $$
sleep 3
exit 0
#!/bin/bash
echo Hello
echo "Staring script $0"
USER=$2
fruits=$@
HOST=$1
T=test.file
if [ -e $T ]
then
echo $T exists
else
echo file not exists
fi
read -p "Enter the country" country
for COLOR in "${fruits}" #start from 2nd element
do
echo "Color: $COLOR"
done
ping -c 1 $HOST
if [ "$?" -ne "0" ]
then
echo $HOST unreachable
exit 1
else
echo $HOST is reachable
fi
echo "User $USER, country $country"
echo PID is $$
sleep 3
exit 0
Comments
Post a Comment