cudcv@warwick.ac.uk (Rob McMahon) (09/02/89)
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