Subj : Re: How to execute more than one command with find -exec? To : comp.os.linux From : Hrvoje Spoljar Date : Thu Nov 25 2004 02:09 am IANAL_VISTA na grupi comp.os.linux pise: [cut] >> I tried >> find XXX -name "*.gif" -exec grep {} abc.txt || rm {} \; >> But it seems -exec don't take behind as a combination of two commands. >> Anybody can tell me how to execute more than one command with find -exec? >> Thanks >> > > Try creating a script that contains everything you want to do. > > P.S. > I know all about using "|" as the pipe operator. > What does "||" (double pipe) supposed to do? same like in c, in [ba]sh it's OR operator... though it seems misused in statement find XXX ... rm {} \; would be executed only when find XXX ... statement generated output on sterr few examples... ls /somedir || echo " somedir does not exist " 2>/dev/null or test -x /etc || echo "/etc does not exist" -- ____ __ ___| | ___ Data,I thought .~. hrvoje.spoljar@><.pbf.hr (_-< '_ \/ _ \ |_/ -_) you were dead! / V \ irc # RoCkY /__/ .__/\___/__/\___| -No Sir, I /( )\ icq : 53000945 |_| rebooted:) ^-^ http://spole.pbf.hr .