From owner-freebsd-questions Sun Oct 14 18: 9:34 2001 Delivered-To: freebsd-questions@freebsd.org Received: from pemaquid.safeport.com (pemaquid.safeport.com [204.156.12.58]) by hub.freebsd.org (Postfix) with ESMTP id CA9F537B40A for ; Sun, 14 Oct 2001 18:09:31 -0700 (PDT) Received: from localhost (doug@localhost) by pemaquid.safeport.com (8.11.5/8.11.1) with ESMTP id f9F19Ul31729 for ; Sun, 14 Oct 2001 21:09:31 -0400 (EDT) (envelope-from doug@safeport.com) X-Authentication-Warning: pemaquid.safeport.com: doug owned process doing -bs Date: Sun, 14 Oct 2001 21:09:30 -0400 (EDT) From: To: freebsd-questions@FreeBSD.ORG Subject: sh script question Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I want to read a file line-wise. The following: _______________ #!/bin/sh USER="doug" FILE="newuser.form" if [ ! -e ${FILE:-$1} ]; then echo "File: ${FILE:-$1} not found" exit 1 fi for Line in `cat ${FILE:-$1}`; do echo $Line done --------------- gives the file a field per read. The field delimiter being blank/whitespace. The obvious answer would seem to be "IFS=" but I can not figure out the syntax or even if that is possible. Thanks for any pointers _____ Douglas Denault doug@safeport.com Voice: 301-469-8766 Fax: 301-469-0601 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message