私がここでやろうとしているのは、ユーザーが複数の引数 (ファイル名) を入力してごみ箱に送信できるようにすることです。私が作成した sh スクリプトは "sh safe_rm" と呼ばれます
だから私はこれをします:
$] sh safe_rm testFile2 testFile 3
両方のファイルを渡すことができる必要があります。何かアイデアはありますか?
file=$1
if [ $# -eq 0 ]
then
echo "You have not entered a file"
exit
elif [ -d $file ]
then
echo "Your file is a directory"
exit
elif [ -e $file ]
then
sendToBin
else
echo "Your file $file does not exist"
exit
fi