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
Convert two column data into 8 columns NickC Shell Programming and Scripting 8 06-28-2008 12:19 PM
How to write data in column c0384 Shell Programming and Scripting 8 07-28-2007 06:18 PM
Column data reading FarhanNaseer Shell Programming and Scripting 1 09-19-2005 01:02 AM
glance RSS/VSS data column xtrix HP-UX 0 01-17-2005 10:32 AM
Move data from Column to Row danhodges99 Shell Programming and Scripting 4 05-19-2003 11:23 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-04-2007
bobk544 bobk544 is offline
Registered User
  
 

Join Date: Jan 2006
Location: fairfax virginia
Posts: 58
Need to get the first column of data

Hello,

if i have a file with this in it:

aaaa bbbb cccc dddd

how can i read that file and move the first column only into a variable?

i've been trying the cut command but can't seem to get it right, ie

HTML Code:
 wc                            all_flist_zp.out > wc.out
cut -b 1  wc.out > wc.out2
cat wc.out2
                                        passvar=`cat wc.out2`
                                        passvar=`echo $passvar | sed -e 's/^ *//' -e 's/ *$//'`
                                        echo "passvar:" $passvar
echo $passvar
Thanks very much for reviewing this!
BobK
 

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 01:50 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