[NTLUG:Discuss] How to get mv to not report when there are no files?

Leroy Tennison leroy_tennison at prodigy.net
Sat Nov 10 23:48:02 CST 2007


Wayne Walker wrote:
> I love linux/unix:
> 
> cd /home/johnc && ls | xargs -r mv --target-directory /var/www/html/incoming
> 
> On Tue, Nov 06, 2007 at 09:44:11AM -0600, Neil Aggarwal wrote:
>> Hello:
>>
>> I have a cron job with this command:
>> mv /home/johnc/* /var/www/html/incoming
>>
>> If there is a file in the /home/johnc directory, I get
>> no output, but when the directory is empty, I get this
>> notification to the root email account:
>>
>> mv: cannot stat `/home/johnc/*': No such file or directory
>>
>> This job runs every 5 minutes so this is annoying.
>>
>> Is there a way to supress that output?
>>
>> Thanks,
>> 	Neil
>>
>> --
>> Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com
>> Eliminate junk email and reclaim your inbox.
>> Visit http://www.spammilter.com for details.
>>
>>
>> _______________________________________________
>> http://www.ntlug.org/mailman/listinfo/discuss
> 
Slick, the best answer I've seen yet.



More information about the Discuss mailing list