On 25 Jun 2000, [ISO-8859-1] François Pinard wrote: fp> [S.Toms] fp> fp> > How can I test to see if a particular file contains a particular string fp> > anywhere within it, for example, I want to see if the filename contains fp> > .lock as the suffix. fp> fp> Hello. I think the following might work (from memory, untested): fp> fp> fp> if grep -s 'STRING' FILE >/dev/null; then fp> ACTIONS_IF_FOUND fp> else fp> ACTIONS_IF_NOT_FOUND fp> fi fp> Actually, I'm looking for a way to check the filename, not the file contents, for example, I have the following being passed into the script /home/skull/mail/Mailing Lists/SuSE List and I want to check to see if there is a "SuSE List.lock" within that above string, I've tried the following which doesn't seem to work if [ "$FILE" != "*.lock" ]; then Basically, what it comes down to is I have a script that checks my mailing lists boxes and if they are empty and havn't been accessed in over 5 min, it will pass the name of the list to a routine, that checks to see if a lock file exists on it (from procmail) if not, it will delete it. Thus, nolonger showing the empty mailbox so I don't have to keep checkign if there are messages in it. fp> -- S.Toms - tomas@primenet.com - www.primenet.com/~tomas SuSE Linux v6.3+ - Kernel 2.2.14 -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/