From owner-freebsd-questions@FreeBSD.ORG Sat Aug 23 10:39:42 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18C491065672 for ; Sat, 23 Aug 2008 10:39:42 +0000 (UTC) (envelope-from david+dated+1219918782.39167f@skytracker.ca) Received: from 3s1.com (3s1.com [209.161.205.12]) by mx1.freebsd.org (Postfix) with ESMTP id AD0C98FC14 for ; Sat, 23 Aug 2008 10:39:41 +0000 (UTC) (envelope-from david+dated+1219918782.39167f@skytracker.ca) Received: from 3s1.com (localhost [127.0.0.1]) by 3s1.com (8.13.8/8.13.8) with ESMTP id m7NAJglc044857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 23 Aug 2008 06:19:43 -0400 (EDT) (envelope-from david+dated+1219918782.39167f@skytracker.ca) Received: (from david@localhost) by 3s1.com (8.13.8/8.14.1/Submit) id m7NAJgle044854 for questions@freebsd.org; Sat, 23 Aug 2008 06:19:42 -0400 (EDT) (envelope-from david+dated+1219918782.39167f@skytracker.ca) X-Authentication-Warning: 3s1.com: david set sender to david+dated+1219918782.39167f@skytracker.ca using -f Received: by torontogenerator.com (tmda-sendmail, from uid 1000); Sat, 23 Aug 2008 06:19:42 -0400 Date: Sat, 23 Aug 2008 06:19:42 -0400 To: questions@freebsd.org Message-ID: <20080823101941.GA42601@skytracker.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: David Banning X-Virus-Scanned: ClamAV 0.91.2/8077/Sat Aug 23 03:28:12 2008 on 3s1.com X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on 3s1.com Cc: Subject: space char shell script problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Aug 2008 10:39:42 -0000 I am running into a problem with the space character in filenames. For instance, If I want to run the script; for x in `ls` do echo $x done then filenames that have a space in them ie: "john smith.jpg" are processed by my script as two names, "john" and "smith.jpg". What is the best way to deal with this type of space problem in the shell? I know that file names in quotes solves some problems but I can't tranfer that to my script.