bug-bash
[Top][All Lists]
Advanced

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

last `set option value' always passed as $1 and $2 during a 'source' ??


From: Philip Lijnzaad
Subject: last `set option value' always passed as $1 and $2 during a 'source' ??
Date: 11 Jun 2001 13:09:45 +0100

Dear all, 

here's a puzzler: when source'ing the following script foo: 
------------------------------------------------------------------------
echo dollarhash is: $#, containing 0: $0,  1: $1, 2: $2
------------------------------------------------------------------------

and source is simply as `source ./foo', I get: 

  dollarhash is: 2, containing 0: -bash, 1: horizontal-scroll-mode, 2: on

this is the case when I have a set horizontal-scroll-mode on in my .bashrc.
When I comment out the ``set horizontal-scroll-mode on' in the calling shell,
I don't see these funny options. It appears that the last 
``set option value'' is always given as $1 and $2 to a source'd script.
This is fairly weird to me, and it's documented nowhere (at least I couldn't
find it).  Is this a bug, or intended ? What's the way to avoid it ?

I get this behaviour everywhere: 

GNU bash, version 2.04.0(1)-release (sparc-sun-solaris2.7)
GNU bash, version 2.04.0(1)-release (i686-pc-linux-gnu)
GNU bash, version 2.04.0(1)-release (alphaev56-dec-osf4.0e)
GNU bash, version 2.01.1(1)-release (alpha-dec-osf4.0)
GNU bash, version 2.04.0(1)-release (mips-sgi-irix6.5)


Any help appreciated.  With kind regards,
                                                                      Philip
-- 
If you have a procedure with 10 parameters, you probably missed some. (Kraulis)
-----------------------------------------------------------------------------
Philip Lijnzaad, lijnzaad@ebi.ac.uk \ European Bioinformatics Institute,rm A2-08
+44 (0)1223 49 4639                 / Wellcome Trust Genome Campus, Hinxton
+44 (0)1223 49 4468 (fax)           \ Cambridgeshire CB10 1SD,  GREAT BRITAIN




reply via email to

[Prev in Thread] Current Thread [Next in Thread]