Re: exec, redirections and variable expansions

2010-01-26 Thread Marc Herbert
mike bakhterev a écrit : > > Description: > Something is wrong with variable substitution in the exec invocation. > When i try to close file descriptor whose number is in variable X with > command: > > exec $X>&- I think the operator is 2> as a whole; you cann

Re: Selecting out of an array

2010-01-26 Thread Marc Herbert
DennisW a écrit : > Also, don't use ls like this - it's eyes-only. Here is a demonstration: touch "filename with spaces" ARRAY=( $(ls) ) # BUG for f in "${arr...@]}"; do echo "file: $f"; done ARRAY=( * ) # OK for f in "${arr...@]}"; do echo "file: $f"; done

Using 'eval'

2010-01-26 Thread Gerard
This is probably a dumb question; however, I have a question regarding 'eval'. I have seen the following statements: eval $(foo -a -b) and eval foo -a -b Are they equal or are there differences between them, other than how they are written out? Does it make any difference which syntax is used

Re: Using 'eval'

2010-01-26 Thread Pierre Gaston
On Tue, Jan 26, 2010 at 1:27 PM, Gerard wrote: > This is probably a dumb question; however, I have a question > regarding 'eval'. > eval foo -a -b eval will execute foo -a -b. > eval $(foo -a -b) foo -a -b will run before eval is executed, the output of foo will replace the $( ). ie if foo -a -

Re: Using 'eval'

2010-01-26 Thread Marc Herbert
Gerard a écrit : > This is probably a dumb question; however, I have a question > regarding 'eval'. If you know other programming languages, then it helps to consider "eval" as a technique that generates code at run time (and runs it immediately).

Colored command completion

2010-01-26 Thread Peng Yu
I'm wondering if it is possible to color the files shown by command completion (i.e. after typing ). The color scheme can be of the same as the one used in "ls --color=auto". By this way, it is easier to see what the type of the file is.

Re: exec, redirections and variable expansions

2010-01-26 Thread Chet Ramey
On 1/25/10 8:32 AM, mike bakhterev wrote: > Bash Version: 4.0 > Patch Level: 35 > Release Status: release > > Description: > Something is wrong with variable substitution in the exec invocation. > When i try to close file descriptor whose number is in variable X with > command:

Re: Colored command completion

2010-01-26 Thread Chet Ramey
On 1/26/10 10:36 AM, Peng Yu wrote: > I'm wondering if it is possible to color the files shown by command > completion (i.e. after typing ). The color scheme can be of the > same as the one used in "ls --color=auto". By this way, it is easier > to see what the type of the file is. You mean the lis

Re: Argument list too long (how to remove the limit)

2010-01-26 Thread Stephane CHAZELAS
2010-01-25, 18:03(-06), Peng Yu: > I got the following message. Is there a way to configure bash such > that there is not a limit like this? > > /bin/bash: Argument list too long [...] That's a limitation of the execve(2) system call on some operating systems. GNU Hurd and recent versions of Linux

Re: Colored command completion

2010-01-26 Thread Stephane CHAZELAS
2010-01-26, 09:36(-06), Peng Yu: > I'm wondering if it is possible to color the files shown by command > completion (i.e. after typing ). The color scheme can be of the > same as the one used in "ls --color=auto". By this way, it is easier > to see what the type of the file is. [...] A bit off top

Re: building arrays from non array variables using 'array[${#arr...@]}]='

2010-01-26 Thread Chet Ramey
On 1/25/10 6:58 AM, Mart Frauenlob wrote: > As i came up with this i have to go further ;) ,so i installed bash > 4.1.2 and your new patch and ran tests again with it and 3.1.17, 4.0.35 > versions. > Patch seems to be working for return values of '${#arr...@]}'. > But ${!arr...@]} returns 0 on the