Re: shell usage (syntax) question
At 06:25 AM 8/27/2005, 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 In sh try: /usr/bin/cpio -idmuv 2> /etc/test < /dev/ad0h -Glenn 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) Thanks in advance! -Harry ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: shell usage (syntax) question
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 [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
shell usage (syntax) question
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) Thanks in advance! -Harry pgpbKKQaiZLwN.pgp Description: PGP signature