[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Severe Bash Bug with Arrays
From: |
Greg Wooledge |
Subject: |
Re: Severe Bash Bug with Arrays |
Date: |
Thu, 26 Apr 2012 14:16:06 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Thu, Apr 26, 2012 at 05:54:27PM +0200, Maarten Billemont wrote:
> On 26 Apr 2012, at 01:18, Linda Walsh wrote:
> >
> > Ishtar:> echo "${b[*]}"
>
> You should always recommend the "${b[@]}" variant. "${b[*]}" is rarely
> useful in the event that your intent is to merge the array into a single
> string, eg. for displaying elements to a user:
> dirs=(*/)
> (IFS=,; echo "The dirs are: ${dirs[*]}")
>
> But anyway, that's an aside from this topic, which has very little to do with
> this.
If the goal is to see the contents of an array, I'd use one of these,
depending on how much detail I need:
printf '<%s> ' "${array[@]}"; echo
declare -p array
- Re: Severe Bash Bug with Arrays, (continued)
Re: Severe Bash Bug with Arrays, Ted Okuzumi, 2012/04/25
Re: Severe Bash Bug with Arrays, Linda Walsh, 2012/04/25
- Re: Severe Bash Bug with Arrays, Maarten Billemont, 2012/04/26
- Re: Severe Bash Bug with Arrays, Linda Walsh, 2012/04/26
- Re: Severe Bash Bug with Arrays, Mike Frysinger, 2012/04/27
- Re: Severe Bash Bug with Arrays, Greg Wooledge, 2012/04/27
- Re: Severe Bash Bug with Arrays, Linda Walsh, 2012/04/27