From owner-freebsd-questions@FreeBSD.ORG Sat Aug 27 14:48:16 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 6B9DE16A41F for ; Sat, 27 Aug 2005 14:48:16 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: from pne-smtpout2-sn2.hy.skanova.net (pne-smtpout2-sn2.hy.skanova.net [81.228.8.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07DBA43D45 for ; Sat, 27 Aug 2005 14:48:15 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: from falcon.midgard.homeip.net (212.181.162.201) by pne-smtpout2-sn2.hy.skanova.net (7.2.060.1) id 42B94E2900AB1CBE for freebsd-questions@freebsd.org; Sat, 27 Aug 2005 16:48:14 +0200 Received: (qmail 23343 invoked by uid 1001); 27 Aug 2005 16:48:13 +0200 Date: Sat, 27 Aug 2005 16:48:13 +0200 From: Erik Trulsson To: Emanuel Strobl Message-ID: <20050827144813.GA22941@falcon.midgard.homeip.net> Mail-Followup-To: Emanuel Strobl , freebsd-questions@freebsd.org References: <200508271525.37192@harrymail> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200508271525.37192@harrymail> User-Agent: Mutt/1.5.9i Cc: freebsd-questions@freebsd.org Subject: Re: shell usage (syntax) question 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, 27 Aug 2005 14:48:16 -0000 On Sat, Aug 27, 2005 at 03:25:27PM +0200, Emanuel Strobl wrote: > Hello, > > how can I delimit a program parameter from a shell instruction? > Example: I want to tell the shell that stderr should be redirected to > file /tmp/test, not cpio to use /file/test: > > # /usr/bin/cpio -idmuv < /dev/ad0h 2> /tmp/test > > This doesn't work, I guess cpio grabs the ">". How can I write it that the > shell sees the ">"? (sh, but also interesting for csh) The example you give above *is* the correct syntax for having stderr of 'cpio' redirected to /tmp/test (instead of to the tty as is the normal case.) The shell reads and takes care of all the redirection stuff before starting the program. In the example above 'cpio' will not see the "< /dev/ad0h 2>/tmp/test" part of the commandline, since the shell will not pass it along to the program. -- Erik Trulsson ertr1013@student.uu.se