Help with scripts

script that ask for "enter a file name" and removes that file
and asks for confirmation before deletion
if executed the output might look as
enter the filename you intent to deleted
remover file? Y
file deleterd

I knwo the comand I would use

find . -name *.* -ok rm {}\; I guess... can someone help me

Hmm. You're on the right track, but rather than use find, I'd do something like.

#!/bin/sh

echo "Enter file name"
read filename

if [ ! -e "$filename" ]; then
  echo "File does not exist" && exit 1
fi

echo "Do you want to delete $filename?"
read response

case $response in
  [yY]) rm $filename
        echo "File deleted" ;;
  *)    echo "File not deleted" ;;
esac

exit 0

This isn't tested, by the way, although it should work.

Oh, you could just do "rm -i filename" too! :wink:

Cheers
ZB