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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh: cmd output to input of another script IMTheNachoMan Shell Programming and Scripting 2 04-27-2008 09:58 AM
Using output to input another command rodrimuino Shell Programming and Scripting 3 02-14-2008 12:37 PM
v3fshelper: There is an input or output error padawan75 AIX 2 11-21-2007 08:56 AM
kickstart output/input maskot Red Hat 3 05-31-2007 10:24 AM
log script input and output using tee ? moseschrist Shell Programming and Scripting 0 11-12-2006 03:32 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-26-2007
BkontheShell718 BkontheShell718 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 6
Using Output from one command as input to another

This site has been very helpful thus far.. I thank you all in advance for sharing the knowledge. Let me get to it.

I am trying to write a very small script to take away from the boredom of doing the same thing over and over.

Everynow and again I have to get the hex value of a file using a d2h. I wrote a one line wrapper around it so that I would have to create symlinks or change directories and I needed to brush up anyway.

#!/bin/bash
/xxx/xxxx/bin/d2h $1

Automatically the output is sent to my screen. How can I change that so that I can just pull that output and add this line into my script so that I can kill 2 birds with one stone??:

cd /xxx/xxxx/data
find . -name \*$OUTPUTFROMLAST COMMAND\* -ls

Please excuse my lack of challenge to some of you, I have been out of the industry for 3 years... I am trying to get this stuff to come back to me.



THanks in advance.
  #2 (permalink)  
Old 12-26-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
Code:
fname=$( /path/to/d2h $1)
cd /xxx/xxxx/data
find . -name '*'$fname'*' -ls
  #3 (permalink)  
Old 12-26-2007
BkontheShell718 BkontheShell718 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 6
I love this place,
I cant thank you enough!!!!!! Seasons greetings
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0