Here is my loop
ls -ltrd * | head -n -3 | awk '{print $NF}' | while read y; do
rm -iR $y
done
output:
rm: descend into directory
oct_temp17
? rm: descend into directoryoct_temp18
? rm: descend into directoryoct_temp19
? ....
It does not prompt for user confirmation which rm -i should ideally when run manually.
I m using bash shell on Linux 3.10
I am naive to Unix / Linux. Can you please suggest how can i make the script ask me for confirmation for every folder from the ls output ?