From owner-freebsd-questions Mon May 31 20:44:30 1999 Delivered-To: freebsd-questions@freebsd.org Received: from oitunix.oit.umass.edu (nscs22p3.remote.umass.edu [128.119.179.25]) by hub.freebsd.org (Postfix) with ESMTP id A3C2C14F0A for ; Mon, 31 May 1999 20:44:26 -0700 (PDT) (envelope-from gp@oitunix.oit.umass.edu) Received: (from gp@localhost) by oitunix.oit.umass.edu (8.9.3/8.9.3) id XAA65055 for freebsd-questions@freebsd.org; Mon, 31 May 1999 23:44:47 -0400 (EDT) (envelope-from gp) Date: Mon, 31 May 1999 23:44:46 -0400 From: Greg Pavelcak To: freebsd-questions@freebsd.org Subject: Stupid bash Script Question Message-ID: <19990531234446.A64999@oitunix.oit.umass.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 etc I tried different uses of quotation marks and piping it through awk, but I couldn't get $i to be "firstname lastname" instead of taking on each name individually. I ended up "brute forcing" it by adding the appropriate "whois" and redirection to each line of the file and then running it, but that offends my aesthetic sensibilities. How do I do this right? Thanks. Greg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message