[plug] function error

Stuart Midgley stuart.midgley at ivec.org
Wed Jan 11 22:59:36 WST 2006


perhaps use awk or sed?

Or, you can set the IFS to just <new-line> and do a standard for loop

	IFS=$'\x0a'
	do line in $( cat $FILE ); do
		command on line
	done

or if you don't like octal do

	IFS="<ctrl-v><ctrl-j>"
	do line in $( cat $FILE ); do
		command on line
	done

where <ctrl-v> and <ctrl-j> are holding down the control key and  
pressing the v and j respectively.  This will look like

	IFS="
	"

Stu.


On 11/01/2006, at 22:50, Jon Miller wrote:

> No I want to be able to read in a file (which has over a 100 names  
> in it, each on a separate line) do a series of commands against  
> each name. So I thought if I can get the command to read in a line  
> do the commands and when finished read I the next and perform the  
> same commands until it reaches the end of the file.
>
> JLM


--
Dr Stuart Midgley
Industry Uptake Program Leader
iVEC, 'The hub of advanced computing in Western Australia'
26 Dick Perry Avenue, Technology Park
Kensington WA 6151
Australia

Phone: +61 8 6436 8545
Fax: +61 8 6436 8555
Email: industry at ivec.org
WWW:  http://www.ivec.org






More information about the plug mailing list