LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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, 12:20 PM   #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, 12:45 PM   #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, 01: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 01:20 PM.
 
Old 08-03-2010, 05: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 04:46 PM
C -how do i execute linux commands? ocularbob Programming 7 02-29-2004 02:51 PM
find -exec cricbk Linux - Newbie 4 01-05-2004 08:03 PM
how to execute commands on login k4zau Linux - Software 3 10-12-2003 02:52 PM
error in exec of stage2 trying to execute /usr/bin/runinstall2 Catherine Brett Linux - Newbie 0 07-11-2003 01:59 PM


All times are GMT -5. The time now is 07:39 AM.

Main Menu
Advertisement
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