Re: how to extract an array and sorted by the array

2011-09-06 Thread lina
File 1: 1 C1 2 O1 3 C2 4 C3 5 H3 6 C7 7 O2 8 H22 9 C6 10 H61 11 C5 12 H5 13 C4 14 C8 15 C9 16 C10 17 O3 18 C11 19 C12 20 O4 21 C13 22 C14 23 C15 24 C20 25 H20 26 C16 27 H16 28 C17 29 H17 30 C18 31 O6 32 H62 33 C19 34 O5 35 C21 File 2: 3 H16 4 H5 6 H61 7 H17 9 H20 12 H3 13 C1 14 O1 15 C2 16 C3 17

how to extract an array and sorted by the array

2011-09-06 Thread lina
Hi, How can I extract the array (a b c) out from file 1 10 a 11 b 12 c and sort the file 2: which b whyc what a into the form of what a which b why c -- Best Regards, lina

Re: bash tab variable expansion question?

2011-09-06 Thread Roger
> On Mon, Sep 05, 2011 at 02:59:20AM -0800, Roger wrote: >> On Mon, Sep 05, 2011 at 12:40:02AM -0800, Roger wrote: >>>The option works, as far as I can see. >>>"ls $HOM" completes to "ls $HOME " instead of "ls $HOME/", though. >> >> >>Weird. >> >>On Gentoo here, "echo $HO" does complete to "echo $H

Re: bash tab variable expansion question?

2011-09-06 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 9/5/11 2:05 AM, Martin von Gagern wrote: > On -10.01.-28163 20:59, Chet Ramey wrote: >>> Bash-4.2 tries to leave what the >>> user typed alone, but that leads to an inherently ambiguous situation: >>> when do you quote the `$' in a filename (or, in

Re: bash tab variable expansion question?

2011-09-06 Thread Chet Ramey
On 9/5/11 6:59 AM, Roger wrote: >> On Gentoo here, "echo $HO" does complete to "echo $HOME", but "ls $HO" >> fails to complete here. >> >> (It is enabled here "$ eselect bashcomp list |grep coreutils". Just to >> verify, I just wiped $HOME/.bash_completion.d/ and renabled everything and >> still

Re: bash tab variable expansion question?

2011-09-06 Thread Chet Ramey
On 9/5/11 4:40 AM, Roger wrote: >> The option works, as far as I can see. >> "ls $HOM" completes to "ls $HOME " instead of "ls $HOME/", though. This is not going to work until I do something else. Readline decides whether or not to append a slash to a directory name, and it doesn't know that $HOM

Re: bash tab variable expansion question?

2011-09-06 Thread Chet Ramey
On 9/4/11 9:51 PM, Clark J. Wang wrote: > Tested with 4.2.10. Overall it works fine for me. But it still has problem > for following scenario: > > $ complete -d -o bashdefault cd > $ cd $PWD > # it expands to this: > $ cd \$PWD > > Bash 4.1 also behaves like that so I'm not sure if it's OK. Out