The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > The Lounge > What's on Your Mind? > Chat with iBot - Our RSS Robot Girl
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-10-2007
brain_full brain_full is offline
Registered User
 

Join Date: Dec 2006
Posts: 6
using cut command

i have a file and i want to use cut command in my program.
file has data as
34
154
189
200
....
numbers in diff row and i want to access these numbers one by one by passing argument as interger (1 then 2 the 3 .....) for each row and want to get these no stored in a variable
I used command as
a=`cut -f$i-$i filename`
but i do not succeeded
Do i use sed instead of cut
Plz help me.
(Actually i want to access groupid from /etc/group and the make them uniq then i wanted the name of user associated with that groupid)
Forum Sponsor