Bug in #! processing
Sławek Żak
zaks at prioris.mini.pw.edu.pl
Tue Sep 28 11:12:30 PDT 2004
Hi,
It seems that there is a long standing bug in processing of command-line
options for scripts and such. Take following files:
[main.c]
#include <stdio.h>
int main(int ac, char **av)
{
int i;
printf("Main.c test\n");
for(i = 0; i < ac; i++) {
printf("%s\n", av[i]);
}
}
[tst.sh]
#!./main -#!
print ok
On FreeBSD 5.x:
thirst<zaks>(1790)% ./tst.sh
Main.c test
./main
-
./tst.sh
On Solaris:
sb8:root> ./tst.sh
Main.c test
./main
-#!
./tst.sh
sb8:root> uname -a
SunOS sb8 5.8 Generic_108528-21 sun4u sparc SUNW,UltraAX-i2
On Tru64:
root at tytus> ./tst.sh
Main.c test
main
-#!
./tst.sh
root at tytus> uname -a
OSF1 tytus V5.1 2650 alpha
On AIX:
scooter:/tmp # ./tst.sh
Main.c test
./main
-#!
./tst.sh
scooter:/tmp # uname -a
AIX scooter 2 5 005EF19C4C00
Any takers?
/S
More information about the freebsd-current
mailing list