SunQuest
           Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old July 9th, 2002, 05:56 AM
knt knt is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 21 knt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 48 sec
Reputation Power: 0
Send a message via ICQ to knt
executing command outputs in bash

hi all
i want to use the each output of such commands like find or ls

for example i have function called make_sth()
and i want all of the outputs of "find /var/www -type f" to be executed with make_sth()

i hope i managed to explain my problem

best regards...

Reply With Quote
  #2  
Old July 9th, 2002, 08:36 AM
christo's Avatar
christo christo is offline
Introspective
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Nov 2001
Location: London, UK
Posts: 3,296 christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 1 h 5 m 9 sec
Reputation Power: 101
Send a message via ICQ to christo Send a message via Yahoo to christo
you can auto-interpolate find results into a pair of curly braces {} eg

find /usr -name *.c -exec grep main \{\} \; -print.

will find in /usr all files with a .c extention and then grep for main function definitions from each result, as if they were interpolated one by one into the braces. the results are then printed

So the important thing here is the -exec option

I'm talking backwards


christo

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > executing command outputs in bash


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway