Click to See Complete Forum and Search --> : Simple Bash script help


sym
08-23-2001, 11:22 AM
I want to write a script that will recursively parse a directory and delete any file the ends with "~". What I have tried so far is:


#!/bin/bash

rm -rf *.*~


This doesn't seem to work.

Any help would be appreciated.

dvdnut
08-23-2001, 11:52 AM
./ maybe?

also you need to make it executable

chmod +x i think

AND

run it as root as becasue anything created as root and being deleted by user will not work but vice versa will

sym
08-23-2001, 12:01 PM
It does run ok, the problem is that if there is not a file that matches the criteria in the folder in which it is executed from, it stops. If there IS a file that matches *.*~ in that original folder, it runs fine. I don't understand how to avoid this problem.

Thanks

X_console
08-23-2001, 12:05 PM
Moving this to the Programming forum. You should get more replies there.