Unix script question (basic)
From: Piestiany7 (piestiany7_at_aol.com)
Date: 03/05/04
- Next message: Daniel Edwins: "Help me with Unix on Mac OS X..Trying to install x11/fink/gnome"
- Previous message: Michael Heiming: "Re: Pls help with Unix shell question"
- Next in thread: Chris F.A. Johnson: "Re: Unix script question (basic)"
- Reply: Chris F.A. Johnson: "Re: Unix script question (basic)"
- Reply: Michael Tosch: "Re: Unix script question (basic)"
- Reply: Stephane CHAZELAS: "Re: Unix script question (basic)"
- Reply: those who know me have no need of my name: "Re: Unix script question (basic)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 05 Mar 2004 18:44:12 GMT
Some time ago on these boards someone suggested a good
way of finding out how many columns there were in a file
read x < $1
set -- $x
columns=$#
I have two questions
1) what effect is set -- $x having (ie in enabling subsequently for $# to have
meaning)
2) if we were to put this into a loop to read every single row in the file and
output the number of columns, can we use a construct like
<command> | while read row
if so what can we have for 'command'? cat looks at a field at a time
thanks.
- Next message: Daniel Edwins: "Help me with Unix on Mac OS X..Trying to install x11/fink/gnome"
- Previous message: Michael Heiming: "Re: Pls help with Unix shell question"
- Next in thread: Chris F.A. Johnson: "Re: Unix script question (basic)"
- Reply: Chris F.A. Johnson: "Re: Unix script question (basic)"
- Reply: Michael Tosch: "Re: Unix script question (basic)"
- Reply: Stephane CHAZELAS: "Re: Unix script question (basic)"
- Reply: those who know me have no need of my name: "Re: Unix script question (basic)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|