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 Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 09-23-2002
omran omran is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 60
awk

Hi All,

i want to excute this in a shell script


awk -F"," 'NR == $i {print S1}' $file_name

and assign the return to variable x

the problem is how to compile the $i while it is between single qutations?

thanx
  #2 (permalink)  
Old 09-23-2002
albaghdady albaghdady is offline
Registered User
  
 

Join Date: Sep 2002
Posts: 2
Unhappy

i reach to this for now

echo awk -F'","' "'"NR == "$i"{print \$1}"'" $file|sh

but there still missing part in how to assign this to variable x
  #3 (permalink)  
Old 09-23-2002
albaghdady albaghdady is offline
Registered User
  
 

Join Date: Sep 2002
Posts: 2
Cool

try this


x=`echo awk -F'","' "'"NR == "$i"{print '$1'}"'" $file|sh`

echo $x


regards
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 12:19 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