[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: weird problems persist

> For some reason, the `uname -s` expands to "Linux Linux" when the
> script is sourced, but only "Linux" on the command line.
> mastermind% set -x
> mastermind% source testshell.sh 
> + source testshell.sh
> +++ uname -s
> ++ '[' Linux Linux = Linux ']'
> -bash: [: too many arguments
> ++ echo 'This is not Linux.'
> This is not Linux.

Just to clarify, this problem is not limited to the uname command.

Running "make" in /var/yp is failing becuase of a similar construct.
The Makefile does:

  test ! -d $(LOCALDOMAIN) && mkdir $(LOCALDOMAIN)

LOCALDOMAIN is `/bin/domainname` so this becomes:

  test ! -d `/bin/domainname` && mkdir `/bin/domainname`

but /bin/domainname has double output for some reason, resulting

set -x ; test ! -d `/bin/domainname` && mkdir `/bin/domainname` ; \
cd `/bin/domainname`  ; \
true || /usr/bin/make -f ../Makefile ypservers; \
/usr/bin/make -f ../Makefile all
++ /bin/domainname
+ test '!' -d pnylab pnylab
/bin/sh: line 1: test: pnylab: binary operator expected


Reply to: