「rm -i」を繰り返す方法は?

「rm -i」を繰り返す方法は?
echo "$MOUNTPOINTLIST" | while read onelinefortouch; do touch "${onelinefortouch}testfileforwrite"; done
echo "$MOUNTPOINTLIST" | while read onelineforrm; do rm -i "${onelineforrm}testfileforwrite"; done

質問:ただし、「rm -i」を実行すると、ファイルは 1 つずつ表示されません。なぜ?この問題をどのように解決しますか?

ベストアンサー1

rm -iユーザーは標準入力でも入力する必要があるからです。この試み:

echo "$MOUNTPOINTLIST" | while read onelineforrm; do rm -i "${onelineforrm}testfileforwrite" < /dev/tty; done

おすすめ記事