The UNIX and Linux Forums  

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
Passing shell variable to NAWK wakhan Shell Programming and Scripting 1 04-23-2008 03:52 AM
passing a variable inside a variable to a function KingVikram UNIX for Dummies Questions & Answers 2 01-14-2008 08:28 PM
Passing PL/SQL variable value to Shell Varible ganapati Shell Programming and Scripting 10 01-31-2007 02:17 AM
variable passing to sed Manish Jha Shell Programming and Scripting 2 08-18-2006 12:54 PM
passing awk variable to the shell script bcheaib Shell Programming and Scripting 3 07-21-2004 11:00 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-24-2002
trynew trynew is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 50
passing value to shell variable

dear all

How to passing the parameters or results to outside of the AWK program? anyone can help

awk '{print $1}' file1 > $a ?
  #2 (permalink)  
Old 06-24-2002
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
I'm not completely sure I understand what you want to do.

But, if you are attempting to set a variable, you can try the following:

sh or ksh
$ xx=`awk '{print $1}' /etc/hosts`

csh
set mm=`awk '{print $1}' /etc/hosts`

You just have to be careful since a file could contain information than you can put into one variable (Sorry, don't recall the limit off the top of my head)
  #3 (permalink)  
Old 06-24-2002
trynew trynew is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 50
Talking

it's worked, Thanks RTM



One can't help many, but many can help one
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 08:32 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