入力されたファイルを消す。

#!/bin/sh
echo "please input file name"
read FILENAME
rm $FILENAME




Yes/Noプロンプト付き。

#!/bin/sh
echo "plz input file name"
read FNAME
echo "remove file ? [y/n]"
read ANS
if [ $ANS = 'y' -o $ANS = 'yes' ]; then
  echo "rm $FNAME"
  rm $FNAME
fi
























最終更新:2008年08月08日 14:23