From owner-freebsd-questions Thu Nov 21 12:10:52 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC07237B401 for ; Thu, 21 Nov 2002 12:10:50 -0800 (PST) Received: from hotmail.com (oe62.law12.hotmail.com [64.4.18.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D6A943E91 for ; Thu, 21 Nov 2002 12:10:50 -0800 (PST) (envelope-from b1henning@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 21 Nov 2002 12:10:50 -0800 X-Originating-IP: [192.216.212.193] From: "Brian Henning" To: Subject: shell script Date: Thu, 21 Nov 2002 14:10:48 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: X-OriginalArrivalTime: 21 Nov 2002 20:10:50.0242 (UTC) FILETIME=[1626AE20:01C2919A] 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 Hello, i have a simple shell script problem. if i have a file name with a space in the name the following script doesn't get the entire name. The for loop conditional statement below stops for spaces or new lines... i would like it to stop for just new lines. is there a way to do that with shell script. how can i change the condition in the for loop to do that? Thanks, brian input.txt -------- Tom Petty - Free Fallin'.mp3 Dave Matthews.mp3 size.sh ------- #!/bin/sh -x # sh size.sh /smb/dc input.txt PATH=$1 INPUT=$2 for i in `/bin/cat ${INPUT}`; do echo "in loop" FILE=`echo $i | /usr/bin/awk -F: '{ print $1 }'` SIZE=`echo $i | /usr/bin/awk -F: '{ print $2 }'` echo "${FILE} done exit 0; current result ------------- Tom Petty - Free Fallin'.mp3 Dave Matthews.mp3 desired result -------------- Tom Petty - Free Fallin'.mp3 Dave Matthews.mp3 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message