bug-bash
[Top][All Lists]
Advanced

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

Re: nullglob option breaks complex parameter expansion/deletion


From: Michael Wardle
Subject: Re: nullglob option breaks complex parameter expansion/deletion
Date: Sat, 02 Jul 2005 11:58:31 +1000

> I also noticed in the POSIX standard that quoting the word part should
> cause it to be literal and prevent globbing.  If I try this in bash, I
> get the same result as in my original message, that is:
> 
> $ shopt -s nullglob
> $ connectioninfo='${HOST%%".*"} ${USER}'
> $ echo $connectioninfo
> ${USER}

Actually, this seems similar to the following:

$ shopt -s nullglob
$ echo $USER
michael
$ var='${USER}".*"'
$ typeset -p var
declare -- var="\${USER}\".*\""
$ echo $var

$ echo "$var"
${USER}".*"
$ eval echo "$var"
michael.*

It looks like a bare $var is being expanded multiple times in a way that
I don't understand, but perhaps that is just the nature of shell.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]