david@utzoo.UUCP (David Trueman) (04/17/84)
In System 5 manual page for the shell (sh(1)), the BUGS section mentions that readonly without arguments produces the same output as export without arguments. I'm not sure why no one fixed this before (the bug is also in V7 and 4.1bsd), because the fix is quite simple. In the file name.c , in the function "printflg", change: IF n->namflg&N_EXPORT THEN prs(export); blank(); FI IF n->namflg&N_RDONLY THEN prs(readonly); blank(); FI IF n->namflg&(N_EXPORT|N_RDONLY) THEN prs(n->namid); newline(); FI to: /* exitval is set in xec.c to N_EXPORT or N_RDONLY */ IF exitval&n->namflg&N_EXPORT THEN prs(export); blank(); FI IF exitval&n->namflg&N_RDONLY THEN prs(readonly); blank(); FI IF n->namflg&exitval THEN prs(n->namid); newline(); FI With these changes, readonly lists only those variables that *are* readonly and likewise for export. -- David Trueman @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!david