The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
borne shell script migg-21 UNIX for Dummies Questions & Answers 1 02-25-2007 08:54 PM
Documenattion on Borne And C shell programming azazalis Shell Programming and Scripting 3 07-09-2006 06:56 AM
Need Help With My First Borne Shell Program FuzzyNips UNIX for Dummies Questions & Answers 3 11-04-2004 03:09 PM
Can there be multi-dimensional variable arrays in borne shell? jparker Shell Programming and Scripting 4 05-15-2002 01:47 PM
Modifying from borne shell to C shell zenkisoft UNIX for Dummies Questions & Answers 3 04-26-2001 01:18 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-06-2006
Registered User
 

Join Date: Apr 2006
Posts: 1
UNIX Find command in Borne Shell

I need to perform two separate commands as part of the -exec section of a find command. Is this possible?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-06-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,355
Use two -exec sequences instead.
find . -name x\* -exec ls -ld {} \; -exec cksum {} \;

But this requires that the first command succeed (exit with 0) or the 2nd will not run. This more complex sequence does not require that...
find . -name x\* \( -exec ls -ld {} \; -o -exec cksum {} \; \)
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0