[NTLUG:Discuss] How to get mv to not report when there are no files?
Rick Renshaw
bofh69 at yahoo.com
Sun Nov 11 11:56:10 CST 2007
--- Wayne Walker <wwalker at bybent.com> wrote:
> On Tue, Nov 06, 2007 at 04:16:18PM -0800, Rick Renshaw wrote:
> > --- Neil Aggarwal <neil at JAMMConsulting.com> wrote:
> > Easiest way would be
> > mv /home/johnc/* /var/www/html/incoming > /dev/null
>
> That will still generate output (error messages go to file descriptor 2,
> aka stderror)
>
> mv /home/johnc/* /var/www/html/incoming 2> /dev/null
>
> will work, BUT will fail to notify you if something goes wrong.
I realized that after I typed that in.
And if you don't want ANY output from a script (on either stdout or stderr), use:
mv /home/johnc/* /var/www/html/incoming > /dev/null 2>&1
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Discuss
mailing list