i have multiple sub directories in a directory . each directory contains a file named files.txt . i want to delete a sub directory which contains empty file names files.txt else not. i am using following script.
#!/bin/bash
while [ -s */files.txt ]
do
line=pwd ;
rm -r "$line" ;
done
this is throwing error too many arguments . i also tried using
if [ -s */files.txt ]
then
line=pwd
rm -r "$line"
else
echo "not empty"
fi
Aucun commentaire:
Enregistrer un commentaire