RE: [OT] Strange bash phenomenon

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

 




> -----Original Message-----
> From: John A. Sullivan III [mailto:jsullivan@xxxxxxxxxxxxxxxxxxx]
> Sent: Monday, February 13, 2006 11:56 AM
> To: pablo@xxxxxxxxxxxxx
> Cc: Netfilter users list
> Subject: RE: [OT] Strange bash phenomenon
> 
> 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 

Hi John,

The 'bad substition' error originates because there are no files which match the expression.

Given you're looking at trying to determine whether a directory has files you could either do it the way you've initially written up your code or use 'find'

The possible 'issue' with the original 'cp *' is if there was a boatload of files in the directory, you could get a shell expansion error.  Probably very unlikely.

One way to handle the corner case is to use find - see the execdir/exec option.

Cheers,
---
Pablo Sanchez - Blueoak Database Engineering, Inc
Ph:    819.459.1926          Toll free:  888.459.1926
Cell:  819.918.9731                Pgr:  pablo_p@xxxxxxxxxxxxx
Fax:   603.720.7723 (US)           Fax:  514.371.1255 (Canada)




[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