Question:
Write a shell script to search a filename in the current working directory
Solution:
echo "Enter the filename that u want to search"
read filename
c=`pwd`
x=`find $c -name "$filename"`
y=$c/$filename
if [ "$x" = "$y" ]
then
echo "Found"
else
echo "Not Found"
fi
Credits: Aditya
Write a shell script to search a filename in the current working directory
Solution:
echo "Enter the filename that u want to search"
read filename
c=`pwd`
x=`find $c -name "$filename"`
y=$c/$filename
if [ "$x" = "$y" ]
then
echo "Found"
else
echo "Not Found"
fi
Credits: Aditya
0 comments:
Post a Comment