The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-22-2005
hugow hugow is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 15
redirect command output to variable

Hi,

I am looking for a way to redirect the result from a command into a variable.
This is the scenario.

Using the find command I will be getting multiple records/lines back.
Here is the command I am using:

find /”path”/ -name nohup.out –print

This now is giving me the paths and file names back as a record/line.
Ex.
/”path1”/ nohup.out
/”path2”/ nohup.out
/”path3”/ nohup.out

I would like to pass these records/lines into a variable line for line and then use the variable line for line in another command echo.

The result would be that I will echo info into the nohup.out files.

Please will you assist me with this?

Thank you for your assistance.

Hugo