LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
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
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
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: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:15 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
Open Source Consulting | Domain Registration