Article View: gnu.bash.bug
Article #532bash 1.03 - positional parameters lost when setting flags
From: Rob McMahon
Date: Sat, 02 Sep 1989 14:09
Date: Sat, 02 Sep 1989 14:09
95 lines
2157 bytes
2157 bytes
Bash 1.03 still loses positional parameters when setting flags:
Script started on Sat Sep 2 14:53:29 1989
cudcv (28) >> ./bash -version
GNU ./bash, version 1.03.15
bash$ echo $-
o
bash$ echo $@
bash$ set a b
bash$ echo $@
a b
bash$ set -f
bash$ echo $@
<= Oops, no positional parameters
bash$ echo $-
fo
bash$ logout
cudcv (29) >> sh
$ echo $-
s
$ echo $@
$ set a b
$ echo $@
a b
$ echo $-
s
$ set -f
$ echo $@
a b <= fine with the Bourne shell
$ echo $-
sf
$ ^D
cudcv (30) >> x
exit
script done on Sat Sep 2 14:55:46 1989
After fix below ...
Script started on Sat Sep 2 14:59:15 1989
cudcv (31) >> ./bash -version
GNU ./bash, version 1.03.16
in .profile
bash$ echo $-
o
bash$ echo $@
bash$ set a b
bash$ echo $@
a b
bash$ set -f
bash$ echo $@
a b <= still okay
bash$ echo $-
fo
bash$ logout
cudcv (32) >> x
exit
script done on Sat Sep 2 15:00:32 1989
And the suggested fix ...
===================================================================
RCS file: builtins.c,v
retrieving revision 1.1
diff -c -r1.1 builtins.c
*** /tmp/,RCSt1a05272 Sat Sep 2 15:01:35 1989
--- builtins.c Sat Sep 2 15:01:18 1989
***************
*** 1842,1848 ****
}
/* Assigning $1 ... $n */
! remember_args (list, 1);
return (EXECUTION_SUCCESS);
}
--- 1842,1849 ----
}
/* Assigning $1 ... $n */
! if (list)
! remember_args (list, 1);
return (EXECUTION_SUCCESS);
}
Rob
--
UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037
JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
Technical Details
Message-ID:
<198@titania.warwick.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!mcsun!ukc!warwick!cudcvShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!mcsun!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: gnu.bash.bug Subject: bash 1.03 - positional parameters lost when setting flags Message-ID: <198@titania.warwick.ac.uk> Date: 2 Sep 89 14:09:22 GMT Reply-To: cudcv@warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 95