reading a list from a file

Andy Heffernan ahh at glyph.kingston.ny.us
Sun Mar 10 02:49:42 AEST 1991


In article <7395 at mentor.cc.purdue.edu> asg at sage.cc.purdue.edu (The Grand Master) writes:
>In article <1991Mar6.175759.18653 at cunixf.cc.columbia.edu> ta-dw30 at cunixa.cc.columbia.edu writes:
>%Is there any way to read a list from a file? For instance, could I say
>%
[...]
> Try:
>for x in `cat filewithlistoffriends` # note these are `s not 's
>do
>finger $x
>done

or (in sh):
	while read blatz
	do
		finger $blatz
	done < some_file

where some_file contains:
	Joe
	Larry
	Bonehead-the-Wonder-Dog
	etc.

-- 
-------------------------------------------------------------------------
  Andy Heffernan		$BJ8;z(J		uunet!glyph!ahh



More information about the Comp.unix.questions mailing list