A shell-script to delete a user-selected file and display a message if it does not exist.

clear

while true;

do

echo -e “Enter the directory name for deleting the zero size file::\c”

read path1

[[ -d $path1 ]] && break

echo not exist name

done

e=find $path1

for i in $e

do

if [ -f “$i” ]

then

rm “$i”

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.