Date: Mon, 31 May 1999 23:52:21 -0500 From: Dan Nelson <dnelson@emsphone.com> To: Greg Pavelcak <gpavelcak@philos.umass.edu> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Stupid /bin/sh Script Question Message-ID: <19990531235221.A62559@dan.emsphone.com> In-Reply-To: <19990531234446.A64999@oitunix.oit.umass.edu>; from "Greg Pavelcak" on Mon May 31 23:44:46 GMT 1999 References: <19990531234446.A64999@oitunix.oit.umass.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (May 31), Greg Pavelcak said: > Starting with a file containing a list of names: > > firstname1 lastname1 > firstname2 lastname2 > . > I wanted to do "whois" on all of them. My idea was: > > for i in `cat file`; do whois $i >> newfile ; done > > But the output of that appears to be what would be generated by: > > whois firstname1 > whois lastname1 > whois firstname2 cat file | while read i ; do whois $i ; done Alternatively, you could probably play with IFS to make the `` only split on newline, but I dislike that approach. -Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990531235221.A62559>