Re: How to execute more than one command with find -exec?

From: Jitender Singh (jisi_nospam_ngh_at__no_spam_adobe.com)
Date: 11/25/04

  • Next message: Roby: "Re: boot floppy to facilitate boot from IDE CDROM on classic Pentium"
    Date: Thu, 25 Nov 2004 11:19:32 GMT
    
    

    try multiple -exec switch

    find xxx -name "*.gif" -exec grep -v abc.txt {} \;  -exec echo {} \; -exec
    rm {} \;

    Cheng Mo wrote:

    > The scenario is:
    > In folder XXX there are lots of *.gif files. Those *.gif files whose
    > filename don't appear in file abc.txt should be deleted. I want to do
    > this job in one line command.
    > find XXX -name "*.gif" -exec ........... \;
    > But I don't know how to write the part of ..............
    >
    > 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


  • Next message: Roby: "Re: boot floppy to facilitate boot from IDE CDROM on classic Pentium"

    Relevant Pages

    • Re: How to execute more than one command with find -exec?
      ... Cheng Mo wrote: ... > filename don't appear in file abc.txt should be deleted. ... > this job in one line command. ...
      (comp.os.linux)
    • Re: How to execute more than one command with find -exec?
      ... Cheng Mo wrote in ... > filename don't appear in file abc.txt should be deleted. ... > this job in one line command. ... I know all about using "|" as the pipe operator. ...
      (comp.os.linux)
    • Re: C2960 config - What do the commands do
      ... To enable visible sequence numbering of system logging messages, use the service sequence-numbers command in global configuration mode. ... Configure the system to automatically switch to summer time. ... This sybnet has the same network address what main network (the subnetted one) but longer subnet mask ... For chassis with 64 MAC addresses, STP uses the extended system ID plus a MAC address to make the bridge ID unique for each VLAN. ...
      (comp.dcom.sys.cisco)
    • Re: proposal: reswitch
      ... > which levels of loops and/or switches and/or ... socket -server command ?-myaddr addr? ... You've got the quick-exit (break, no string), the fall-through to next ... -switch option), then it'd be the nth switch. ...
      (comp.lang.tcl)
    • voice activated Windows shortcuts
      ... It works if the command pause is set to .1 seconds and the ... dictation while in Command Mode and AFAIK there's no hotkey to switch ... switching between windows does not ... back space (click, Backspace, Space) ...
      (comp.speech.research)