RE: [OT] Strange bash phenomenon

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

 




> -----Original Message-----
> From: netfilter-bounces@xxxxxxxxxxxxxxxxxxx
> [mailto:netfilter-bounces@xxxxxxxxxxxxxxxxxxx]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




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux