Look at the following script,"myfile.sh" which runs another shell script called "1.sh" if the given string is "Ashok":
Code:
#myfile.sh
clear
echo -ne "\033[0m"
a=0
while :
do
echo "Enter the Password"
read n
if [[ $n = "Ashok" ]] && [[ -n $n ]]
then
echo -ne "\033[34m"
#sh 1.sh
sh 1.sh
echo -ne "\033[0m"
exit 1
elif [[ $a -ne 3 ]]
then
: $(( a++ ))
echo -ne "\033[31m"
echo "Incorrect Password "
echo -ne "\033[0m"
else exit 1
fi
done
echo -ne "\033[0m"
Here both myfile.sh and 1.sh resides under same directory. I want to run this script for another file that resides on some other directory. How can I achieve this?