Write shell script that takes a file name as an argument and deletes this file from every directory above the pwd.
if [ $# -eq 0 ] then echo "pass the file name" exit fi fl=$1 ch=1 h=/home while [ $ch -eq 1 ] do cd .. p=`pwd` echo "$p/$fl" rm `echo "$p/$fl"` 2> /dev/nullif [ $p = $h ] then ch=0 fi done -------------------------------------------------------------------------------- OUTPUT: [mca264@gama shellscript]$ sh 35.sh file1 /home/symca/mca264/file1 /home/symca/file1 /home/file1