[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
input redirection in subshell before command results in error
From: |
Andrew Brown |
Subject: |
input redirection in subshell before command results in error |
Date: |
Sun, 23 May 2004 02:23:56 -0400 (EDT) |
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: netbsdelf
Compiler: cc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='netbsdelf' -DCONF_MACHTYPE='i386--netbsdelf' -DCONF_VENDOR=''
-DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -I/usr/pkg/include -O2
-I/usr/pkg/include
uname output: NetBSD this 2.0E NetBSD 2.0E (THAT) #328: Thu May 20 11:15:27 EDT
2004 andrew@this:/usr/src/sys/arch/i386/compile/THAT i386
Machine Type: i386--netbsdelf
Bash Version: 2.05b
Patch Level: 0
Release Status: release
Description:
bash can do:
diff -u <(postconf -d) <(postconf)
which is neat, yet most sh-type shells cannot do that. the way that
works in most other sh-type shells that i've found (where /dev/fd
exists) is:
postconf | ( 3<&0 ( postconf -d | diff - /dev/fd/3 ) )
this works in netbsd's sh, solaris's /bin/sh (and solaris's /sbin/sh
and /usr/xpg4/bin/sh), and in irix's sh, at the very least, along with
ksh and zsh. the error given is:
bash: -c: line 1: syntax error near unexpected token `('
bash: -c: line 1: `postconf | ( 3<&0 ( postconf -d | diff - /dev/fd/3 ) )'
Repeat-By:
postconf | ( 3<&0 ( postconf -d | diff - /dev/fd/3 ) )
- input redirection in subshell before command results in error,
Andrew Brown <=