#1  
Old 5th November 2011, 18:38
aspangilinan aspangilinan is offline
Junior Member
 
Join Date: Apr 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via Yahoo to aspangilinan
Smile help me for i command

hi to all,

i have little problem, anyone can help me,
when i run script. the message

here's the script.

find /home/samba/shares/accounting_group -name *.tmp > /root/accounting_tmp3.txt;
for i in `cat /root/accounting_tmp3.txt`;
do rm $i;
done

the error.

rm: cannot remove `/home/samba/shares/accounting_group/OLD': No such file or directory
rm: cannot remove `Hardisk': No such file or directory
rm: cannot remove `2005-2008/Loida/~WRL0699.tmp': No such file or directory
rm: cannot remove `/home/samba/shares/accounting_group/OLD': No such file or directory
rm: cannot remove `Hardisk': No such file or directory
rm: cannot remove `2005-2008/Loida/~WRL0005.tmp': No such file or directory


root@zentyal:/root# find /home/samba/shares/accounting_group -name *.tmp

but still existing the *.tmp file. and i want to delete are files.

/home/samba/shares/accounting_group/OLD Hardisk 2005-2008/Loida/~WRL0699.tmp
/home/samba/shares/accounting_group/OLD Hardisk 2005-2008/Loida/~WRL0005.tmp




Can you help me, help help.

thanks
ARnel
Reply With Quote
Sponsored Links
  #2  
Old 6th November 2011, 12:45
jmerken jmerken is offline
Junior Member
 
Join Date: Nov 2011
Posts: 3
Thanks: 0
Thanked 3 Times in 3 Posts
Smile shell command

I would use xargs for this>>

you need the option -print0 due to spaces in the directory and again the xargs -0 option to be able to work with the spaces when executing the rm command

e.g.

find /home/samba/shares/accounting_group/OLD Hardisk 2005-2008/Loida/ -iname '*.tmp' -print0 | xargs -0 /bin/rm -f

good luck
Jan
Reply With Quote
The Following User Says Thank You to jmerken For This Useful Post:
aspangilinan (6th November 2011)
  #3  
Old 6th November 2011, 15:17
aspangilinan aspangilinan is offline
Junior Member
 
Join Date: Apr 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via Yahoo to aspangilinan
 
Default

Quote:
Originally Posted by jmerken View Post
I would use xargs for this>>

you need the option -print0 due to spaces in the directory and again the xargs -0 option to be able to work with the spaces when executing the rm command

e.g.

find /home/samba/shares/accounting_group/OLD Hardisk 2005-2008/Loida/ -iname '*.tmp' -print0 | xargs -0 /bin/rm -f

good luck
Jan

Thanks thanks Jan,

i hope next time you can help me again.
thanks
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't receive mails baicunko Server Operation 12 3rd August 2011 23:02
Postfix queue problem? murunix Server Operation 7 2nd May 2011 02:55
proFTPd passive mode problems bisbell Server Operation 8 6th August 2008 22:12
i am having some problem ? cobro Installation/Configuration 20 30th April 2008 17:26
help on /etc/rc0.d/K20dnsctl -> ../init.d/dnsctl zimele General 13 23rd August 2006 17:06


All times are GMT +2. The time now is 11:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.