echo "$MOUNTPOINTLIST" | while read onelinefortouch; do touch "${onelinefortouch}testfileforwrite"; done
echo "$MOUNTPOINTLIST" | while read onelineforrm; do rm -i "${onelineforrm}testfileforwrite"; done
问题:但是,当“rm -i”出现时,这不会一一显示文件。为什么?如何解决这个问题?
答案1
因为rm -i
也期望用户从标准输入输入。尝试这个:
echo "$MOUNTPOINTLIST" | while read onelineforrm; do rm -i "${onelineforrm}testfileforwrite" < /dev/tty; done