All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John A. Sullivan III" <jsullivan@opensourcedevel.com>
To: pablo@blueoakdb.com
Cc: Netfilter users list <netfilter@lists.netfilter.org>
Subject: RE: [OT] Strange bash phenomenon
Date: Mon, 13 Feb 2006 11:56:13 -0500	[thread overview]
Message-ID: <1139849773.2960.40.camel@localhost> (raw)
In-Reply-To: <NEBBLLCNFOFHMALJMDDEKEOPBNAB.pablo@blueoakdb.com>

On Mon, 2006-02-13 at 10:50 -0500, Pablo Sanchez wrote:
> > -----Original Message-----
> > From: netfilter-bounces@lists.netfilter.org
> > [mailto:netfilter-bounces@lists.netfilter.org]On Behalf Of John A.
> > Sullivan III
> > Sent: Saturday, February 11, 2006 8:45 AM
> > To: Netfilter users list
> > Subject: [OT] Strange bash phenomenon
> > 
> > Case #1
> > -------
> > FILES=/etc/config/iptables*
> >
> > [ snipped ]
> >
> > Case #2
> > -------
> > FILES=$(echo /etc/config/iptables*)
> > 
> > Any ideas why the latter one works fine but the other does not? Just
> > curious.
> 
> Hi John,
> 
> It has to do when the shell does the expansion.  In the first case when you assign 'FILES=', you're assigning it the string and it's not expanded by the shell.  If you want to change the behavior, you can do this:
> 
> 	FILES=${/etc/config/iptables*}
> 
> btw, Ilove the ${FILES%% *} trick.  I didn't know about it.  The shell is quite nifty.
> 
> -pablo
> 
> 
Thanks.  That makes sense, i.e., unexpanded assignment.  By the way, if
I try FILES=${/iptables*}, I get:

./testbash2: line 2: ${testb*}: bad substitution

But, at least I know how to make it work and understand why the first
approach failed - John
-- 
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
jsullivan@opensourcedevel.com

Financially sustainable open source development
http://www.opensourcedevel.com



  reply	other threads:[~2006-02-13 16:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-11 13:44 [OT] Strange bash phenomenon John A. Sullivan III
2006-02-13 15:50 ` Pablo Sanchez
2006-02-13 16:56   ` John A. Sullivan III [this message]
2006-02-13 18:07     ` Pablo Sanchez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1139849773.2960.40.camel@localhost \
    --to=jsullivan@opensourcedevel.com \
    --cc=netfilter@lists.netfilter.org \
    --cc=pablo@blueoakdb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.