SLUG Mailing List Archives
Re: [SLUG] my next stupid question
- To: Slug <slug@xxxxxxxxxxx>
- Subject: Re: [SLUG] my next stupid question
- From: John Clarke <johnc@xxxxxxxxxxxxxxxxxx>
- Date: Tue Jul 3 14:58:02 2001
- User-agent: Mutt/1.2.5i
On Tue, Jul 03, 2001 at 02:33:19PM +1000, Jeff Waugh wrote:
> <quote who="Alister Waller">
> > for i in `ls *.TXT`
> > do
> > cat $i >> newfilename
> > mv $i /tmp
> > done
> Why cat? cp $i newfilename would do pretty well.
No it wouldn't. Note the `>>'.
> > Now, if there are no *.TXT files then I get an error sent back to the owner
> > of the crontab file.
cat *.TXT >> newfilename 2>/dev/null
mv *.TXT /tmp 2>/dev/null
(cat *.TXT >> newfilename && mv *.TXT /tmp) 2>/dev/null
Note that this will create `newfilename' even if there are no files