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
sql output into a variable purplebirky Shell Programming and Scripting 3 09-09-2009 11:56 AM
awk output in a variable andaluzia Shell Programming and Scripting 5 04-01-2009 04:45 PM
AWK Output into a variable mace_560 Shell Programming and Scripting 2 12-30-2008 04:58 AM
Set a variable from awk output Cranie UNIX for Dummies Questions & Answers 3 10-11-2007 09:39 AM
how to output awk to a variable bashirpopal UNIX for Dummies Questions & Answers 4 04-02-2003 11:02 AM

Reply
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 2 Weeks Ago
Reddy482 Reddy482 is offline
Registered User
  
 

Join Date: Nov 2009
Posts: 15
rediret output to variable...

Hi i have a problem in redirecting the ouput to a variable.I want to use that variable in the script itself.

here is my problem...

unique.out "UNIX" | grep Encrypted | awk '{FS=" "} {print $2}' .

unique.out is and executable file that generates uniqe id WITH THE FOLLOWING FORMAT.
Using Key .....
Trying to Encrypt UNIX ......
Uniqe Code: 123232312434, lenght 32"

AND also i not able to take out of that coma( ,)from the uniqeid. please help me to remove that comma from the output and put that output in a varaible.


please help me on this issue.
Thanks in advance...
.
  #2 (permalink)  
Old 2 Weeks Ago
binlib binlib is offline
Registered User
  
 

Join Date: Aug 2009
Location: New Jersey
Posts: 55
Check man page or usage document of the command. It should have option to output the code only (in fact, it should be the default). If not, the person who wrote the program doesn't understand Unix.
In case of the latter situation, do
Code:
awk -F'[:, ]' '/Uniqe Code:/{print $4}'
if it doesn't work for your awk, then
Code:
awk '/Uniqe Code:/{sub(",", "", $2);print $2}'
Reply

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:04 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