[TUHS] History of #! interpretation in Unix
Cyrille Lefevre
cyrille.lefevre-lists at laposte.net
Thu Jan 20 14:09:43 AEST 2011
Le 19/01/2011 21:35, Sven Mascheck a écrit :
>
> Cyrille Lefevre wrote:
>
>> yet another reference but more in the spirit of what csh does, it only
>> checks for a simple hash (#), no explaim mark (!), and is enclosed in
>> UCB_SCRIPT define.
>>
>> http://minnie.tuhs.org/cgi-bin/utree.pl?file=2.9BSD/usr/src/sys/sys/sys1.c
>
> Perhaps you missed the ! in the macro?
right %-/
> #define SCRMAG '#!'
multi-character character constant !
u.u_exdata.ux_mag == SCRMAG makes me wonder...
$ cat x.c
#include <stdio.h>
main() { int c = '#!'; printf("%x", c); return 0; }
$ make x
cc x.c -o x
x.c:2:18: warning: multi-character character constant
$ ./x
2321
$ man ascii
...
| 20 sp | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' |
...
well, it works !
Regards,
Cyrille Lefevre
--
mailto:Cyrille.Lefevre-lists at laposte.net
More information about the TUHS
mailing list