Re: Is there a special variable for the directory where the script is in?

2010-02-11 Thread Chris F.A. Johnson
On Thu, 11 Feb 2010, Eric Blake wrote: > According to Chris F.A. Johnson on 2/11/2010 4:23 PM: > > On Fri, 12 Feb 2010, Peng Yu wrote: > > > >> $0 gives the file name of the script. I could use several shell > >> command to get the directory where the script is in. But I'm wondering > >> if there

Re: Is there a special variable for the directory where the script is in?

2010-02-11 Thread Eric Blake
According to Chris F.A. Johnson on 2/11/2010 4:23 PM: > On Fri, 12 Feb 2010, Peng Yu wrote: > >> $0 gives the file name of the script. I could use several shell >> command to get the directory where the script is in. But I'm wondering >> if there is an easy-to-use variable that refers to the direc

Re: Is there a special variable for the directory where the script is in?

2010-02-11 Thread pk
Peng Yu wrote: > $0 gives the file name of the script. I could use several shell > command to get the directory where the script is in. But I'm wondering > if there is an easy-to-use variable that refers to the directory where > the script is in? See this page: http://mywiki.wooledge.org/BashFAQ

Re: Is there a special variable for the directory where the script is in?

2010-02-11 Thread Chris F.A. Johnson
On Fri, 12 Feb 2010, Peng Yu wrote: > $0 gives the file name of the script. I could use several shell > command to get the directory where the script is in. But I'm wondering > if there is an easy-to-use variable that refers to the directory where > the script is in? $0 normally gives the full

Is there a special variable for the directory where the script is in?

2010-02-11 Thread Peng Yu
$0 gives the file name of the script. I could use several shell command to get the directory where the script is in. But I'm wondering if there is an easy-to-use variable that refers to the directory where the script is in?

Re: Circulate matches in command completion?

2010-02-11 Thread Peng Yu
On Fri, Feb 12, 2010 at 1:36 PM, DennisW wrote: > On Feb 11, 11:33 am, Peng Yu wrote: >> On Thu, Feb 11, 2010 at 10:36 AM, Chet Ramey wrote: >> > On 2/11/10 11:05 AM, Peng Yu wrote: >> >> On Thu, Feb 11, 2010 at 9:58 AM, Chet Ramey wrote: >> >>> On 2/11/10 10:54 AM, Peng Yu wrote: >> Suppo

Re: undefined reference to `__strtoll'

2010-02-11 Thread Bob Proulx
Greg Wooledge wrote: > Dave Moore wrote: > > Machine: hppa2.0w > > OS: hpux11.00 > > Compiler: gcc > > ... > > My version of GCC is > > > gcc -v > > Using built-in specs. > > Target: hppa64-hp-hpux11.00 > > Configured with: ../src/configure --enable-languages=c,c++ > > --prefix=/usr/local/pa20_64 -

Re: undefined reference to `__strtoll'

2010-02-11 Thread Greg Wooledge
On Thu, Feb 11, 2010 at 12:58:46PM -0500, Dave Moore wrote: > Machine: hppa2.0w > OS: hpux11.00 > Compiler: gcc > Bash Version: 4.1 > Patch Level: 0 I don't have an HP-UX 11.00 machine to test on, but: > I'm having trouble compiling bash on HP-UX 4.1. I can't figure out how to > work around it.

Re: process substitution and trailing file descriptors

2010-02-11 Thread Greg Wooledge
On Thu, Feb 11, 2010 at 03:04:30AM -0800, Ian wrote: > The manual suggests I could move and close file descriptors with > > [n]>&digit- > > but I would need the equivalent of > > command1 >&>(...)- > > Digit might very well mean (just a) digit but here the process > substitution, of course

Re: Circulate matches in command completion?

2010-02-11 Thread DennisW
On Feb 11, 11:33 am, Peng Yu wrote: > On Thu, Feb 11, 2010 at 10:36 AM, Chet Ramey wrote: > > On 2/11/10 11:05 AM, Peng Yu wrote: > >> On Thu, Feb 11, 2010 at 9:58 AM, Chet Ramey wrote: > >>> On 2/11/10 10:54 AM, Peng Yu wrote: > Suppose I file 'a1.txt' and 'a2.txt' in my current directory.

undefined reference to `__strtoll'

2010-02-11 Thread Dave Moore
Configuration Information [Automatically generated, do not change]: Machine: hppa2.0w OS: hpux11.00 Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='hppa2.0w' -DCONF_OSTYPE=' hpux11.00' -DCONF_MACHTYPE='hppa2.0w-hp-hpux11.00' -DCONF_VENDOR='hp' -DLOCALEDI R='/usr/local/share/loc

process substitution and trailing file descriptors

2010-02-11 Thread Ian
Hi, I'm not so sure this is a bug rather than a feature but it has undesirable behaviour to my eye. I found it originally in 3.0.16 but I've just reproduced it in 4.1. If I have a script where I use process substitution to log the output yet keep stdout and stderr as they stand: command1 > >(

Re: [^/]+ vs. [^/]* - Regular Expression bug?

2010-02-11 Thread Morten Lauritsen Khodabocus
Hi again, Oh, right, that makes sense. And like I feared, I was indeed wasting your time. Thanks for the info, sorry about the time. Morten Andreas Schwab wrote: Morten Lauritsen Khodabocus writes: Two regular expressions should match the same thing, but for some reason do not: [[ '/h

Re: Circulate matches in command completion?

2010-02-11 Thread Peng Yu
On Thu, Feb 11, 2010 at 10:36 AM, Chet Ramey wrote: > On 2/11/10 11:05 AM, Peng Yu wrote: >> On Thu, Feb 11, 2010 at 9:58 AM, Chet Ramey wrote: >>> On 2/11/10 10:54 AM, Peng Yu wrote: Suppose I file 'a1.txt' and 'a2.txt' in my current directory. When I type 'cat a' then TAB, it will sho

Re: Circulate matches in command completion?

2010-02-11 Thread Chet Ramey
On 2/11/10 11:05 AM, Peng Yu wrote: > On Thu, Feb 11, 2010 at 9:58 AM, Chet Ramey wrote: >> On 2/11/10 10:54 AM, Peng Yu wrote: >>> Suppose I file 'a1.txt' and 'a2.txt' in my current directory. When I >>> type 'cat a' then TAB, it will show me 'a1.txt' and 'a2.txt'. If I >>> type TAB repeatedly, i

Re: Circulate matches in command completion?

2010-02-11 Thread Peng Yu
On Thu, Feb 11, 2010 at 9:58 AM, Chet Ramey wrote: > On 2/11/10 10:54 AM, Peng Yu wrote: >> Suppose I file 'a1.txt' and 'a2.txt' in my current directory. When I >> type 'cat a' then TAB, it will show me 'a1.txt' and 'a2.txt'. If I >> type TAB repeatedly, it will always show me the same thing. >> >

Re: Circulate matches in command completion?

2010-02-11 Thread Chet Ramey
On 2/11/10 10:54 AM, Peng Yu wrote: > Suppose I file 'a1.txt' and 'a2.txt' in my current directory. When I > type 'cat a' then TAB, it will show me 'a1.txt' and 'a2.txt'. If I > type TAB repeatedly, it will always show me the same thing. > > However, a better response might be > 1. complete the co

Circulate matches in command completion?

2010-02-11 Thread Peng Yu
Suppose I file 'a1.txt' and 'a2.txt' in my current directory. When I type 'cat a' then TAB, it will show me 'a1.txt' and 'a2.txt'. If I type TAB repeatedly, it will always show me the same thing. However, a better response might be 1. complete the command to 'cat a1.txt' at the 2nd TAB, 2. complet

Re: + vs. [^/]* - Regular Expression bug?

2010-02-11 Thread Greg Wooledge
On Tue, Feb 09, 2010 at 09:18:47PM -0800, DennisW wrote: > * means zero or more characters. It found zero and stopped. You could > do: > > [[ '/home/' =~ /([^/]*) ]]; echo ${BASH_REMATCH[1]} Oh, is he trying to get the first non-null component of a /-delimited pathname? I can never tell any more