Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: expert help sought [offtopic]



# jarausch@xxxxxxxxxxxxxxxxxxx / 2006-10-23 08:55:47 +0200:
> I am desparately in need for help on the following piece of
> code within a 'configure' file.
> It's run under '/bin/sh' which is a symlink to '/bin/bash'
> but I known that real experts are reading this mailing list.
> 
> The following code fails in the 2nd line with 
> syntax error near unexpected token `('
> ../htmlwidget2/configure: line 4957: `  case `(ac_space=' '; set | grep ac_space) 2>&1` in'
 
    My experience from porting FreeBSD's periodic(8) to RedHat suggests
    that bash can't parse quite a bit of valid POSIX sh syntax, it loves
    to get lost in parentheses and subshells. Try moving the subshell
    into a separate statement.

> here are the lines 4956 ff
> 
> (set) 2>&1 |
>   case `(ac_space=' '; set | grep ac_space) 2>&1` in
>   *ac_space=\ *)
>     # `set' does not quote correctly, so add quotes (double-quote substitution
>     # turns \\\\ into \\, and sed turns \\ into \).
>     sed -n \
>       -e "s/'/'\\\\''/g" \
>       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
>     ;;
>   *)
>     # `set' quotes correctly as required by POSIX, so do not add quotes.
>     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
>     ;;
>   esac >> confcache
> 
> I admit I don't really understand what's going on and even what's meant
> to be going on.

    The code is meant to write config.cache.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991



Messages sorted by: Reverse Date, Date, Thread, Author