I have a scenario where a script exists to remove files according to the conditions.
Currently the script is like: rem.sh
If [ -e file1 ]; then
rm -f file1
elif [ -e file2 ]; then
rm -f file2
fi
I have another script which calls rem.sh
main.sh
1 rem.sh
2 touch file1
3 xxx
4 xxx
5 xxx
6 rem.sh
7 touch file2
If I run main.sh, It only remove file1 and create file1. Is there way to remove and create file2 and so on?
Aucun commentaire:
Enregistrer un commentaire