
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