SLUG Mailing List Archives
Re: [SLUG] my next stupid question
- To: Slug <slug@xxxxxxxxxxx>
- Subject: Re: [SLUG] my next stupid question
- From: Malcolm Tredinnick <malcolm@xxxxxxxxxxxxxxxxx>
- Date: Tue Jul 3 14:47:01 2001
- User-agent: Mutt/1.2.5i
On Tue, Jul 03, 2001 at 02:23:44PM +1000, Alister Waller wrote:
> another stupid question.
No such thing. :-)
> I am running a script from a cronjob. part of the script is a for loop. see
> for i in `ls *.TXT`
> cat $i >> newfilename
> mv $i /tmp
> Now, if there are no *.TXT files then I get an error sent back to the owner
> of the crontab file.
A fairly common idiom for this is:
if [ "$fileList" != '*' ]; then
...(insert other stuff here)
That should do what you want.
Monday is an awful way to spend 1/7th of your life.