[Klug-general] Bash script to delete folders if they exists

Nathan Friend nathan.friend at gmail.com
Fri Jul 16 08:17:50 UTC 2010


Morning,
I would like a simple bash script to check if a list of user directories
exist and if they do delete them.  If they don't output a message and skip
to next folder to check.  E.g.

Does /Home/user1 exist > Yes > Delete /home/user1 goto next check
                                       No  > "user1 not found" go to next
check
Does /Home/user2 exist > Yes > Delete home/user2 goto next check
                                       No > "user2 not found" go to next
check
end.

Any ideas how I can do this?

Cheers,

Nathan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/kent/attachments/20100716/b0f99a54/attachment.htm>


More information about the Kent mailing list