I need to create a UNIX shell script that takes a directory as an argument, identifies all the files with 0 bytes, prompts the user if it is ok to rename the file, and copies the file adding a .old extension.
So far I know just pieces:
for filename in `ls $Dir'
if [ -s $filename ]
echo 'do you want to change $filename to $filename.old?"
if [ "$answer" = y ]
cp $Dir/$filename $Dir/$filename.old
Thanks for your help!