bug-bash
[Top][All Lists]
Advanced

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

Re: running source twice wont use arguments


From: Chet Ramey
Subject: Re: running source twice wont use arguments
Date: Sat, 18 Oct 2008 13:39:32 -0400
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

pgb wrote:

> What in my environment, post-script-run is making the second source not
> "see" the command line arguments?

Bash doesn't behave as you observe:

$ cat x1
cat > /tmp/x1 <<\EOF
echo source: arguments: "$@"
EOF

. /tmp/x1 -o foo -x bar quux
echo main arguments: "$@"
. /tmp/x1 -o foo -x bar quux

rm -f /tmp/x1
$ ../bash-3.2-patched/bash --version
GNU bash, version 3.2.39(14)-release (i386-apple-darwin9.2.2)
Copyright (C) 2007 Free Software Foundation, Inc.
$ ../bash-3.2-patched/bash ./x1 abcd
source: arguments: -o foo -x bar quux
main arguments: abcd
source: arguments: -o foo -x bar quux

I suspect the difference is due to the use of getopts, as Bernd
Eggink already posited.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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