From owner-freebsd-questions@FreeBSD.ORG Sun Jul 8 16:47:28 2012 Return-Path: Delivered-To: FreeBSD-Questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A98A106566B for ; Sun, 8 Jul 2012 16:47:28 +0000 (UTC) (envelope-from vince@unsane.co.uk) Received: from unsane.co.uk (unsane-pt.tunnel.tserv5.lon1.ipv6.he.net [IPv6:2001:470:1f08:110::2]) by mx1.freebsd.org (Postfix) with ESMTP id E80318FC0A for ; Sun, 8 Jul 2012 16:47:27 +0000 (UTC) Received: from vincemacbook.unsane.co.uk (vincemacbook.unsane.co.uk [10.10.10.20]) (authenticated bits=0) by unsane.co.uk (8.14.5/8.14.5) with ESMTP id q68GlQdS064261 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Sun, 8 Jul 2012 17:47:26 +0100 (BST) (envelope-from vince@unsane.co.uk) Message-ID: <4FF9B99D.4010101@unsane.co.uk> Date: Sun, 08 Jul 2012 17:47:25 +0100 From: Vincent Hoffman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: "FreeBSD-Questions@freebsd.org" X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: for loops with /bin/sh on command line. 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: Sun, 08 Jul 2012 16:47:28 -0000 I'm sure I'm being dim, but why cant I do a for loop on the command line using /bin/sh ? am I suffering from too much use of bash and as such shouldnt expect it to work? banshee# for foo in 1 2 3 ; do echo $foo ; done for: Command not found. foo: Undefined variable. banshee# echo 'for foo in 1 2 3; do echo $foo ; done' > bahh.sh banshee# sh bahh.sh 1 2 3 banshee# Vince