LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-27-2005, 11:20 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
how can I execute two commands on exec of a find?


How can I tell find to run two commands on the files it finds?

Code:
find ./ -exec \
     echo {} \
     cat {} | grep mierda \
';'
What do I have to use as the two command separator? I can't use a ;, right?
 
Old 05-27-2005, 11:45 AM   #2
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
Code:
find . -name file1.cpp -exec ls -l {} \; -exec cat {}  \;
 
1 members found this post helpful.
Old 05-27-2005, 12:17 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
ooooooooooohhhhh, man!

Of cooooooooooooooooourse!

Thanks!

Last edited by eantoranz; 05-27-2005 at 12:20 PM.
 
Old 08-03-2010, 04:51 PM   #4
sporkit
Member
 
Registered: Feb 2004
Posts: 71

Rep: Reputation: 15
Holy freaking duhhh... Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple commands with exec! dtheorem Linux - General 1 03-14-2004 03:46 PM
C -how do i execute linux commands? ocularbob Programming 7 02-29-2004 01:51 PM
find -exec cricbk Linux - Newbie 4 01-05-2004 07:03 PM
how to execute commands on login k4zau Linux - Software 3 10-12-2003 01:52 PM
error in exec of stage2 trying to execute /usr/bin/runinstall2 Catherine Brett Linux - Newbie 0 07-11-2003 12:59 PM


All times are GMT -5. The time now is 08:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration