"#!" scripts, kernel patches, and Xenix

The Beach Bum haugj at pigs.UUCP
Sat Sep 17 06:53:25 AEST 1988


In article <1459 at ssc.UUCP> markz at ssc.UUCP (Mark Zenier) writes:
>Isn't the shell script check implemented in the library routine that
>is linked in, and not the kernel.  This is what Rochkind says in
>"Advanced Unix Programming".  This sounds much easier than disassembling
>half of the kernel.

it depends.  on some systems the '#!' hack is part of the C library.
on others, it is in the kernel.  the actually hack is so simple that
it can be added in one afternoon of work.

i'd guess [ in case ross wants to added it to xenix 2.4 ;-) ] the
best place to start is in gethead().  just look for the appropriate
magic number [ see the previous posting by my ], then jump off and
get the program name since the block has already by read [ there should
be a bread() in gethead() - add an extra field to the x.out header
for the program name or something ... ]

and we are only talking about disassembling 2000 lines of assembler
or so.  shouldn't take more than 3 or 4 days to produce C code from
that ;-)
-- 
=-=-=-=-=-=-=-The Beach Bum at The Big "D" Home for Wayward Hackers-=-=-=-=-=-=
               Very Long Address: John.F.Haugh at rpp386.dallas.tx.us
                         Very Short Address: jfh at rpp386
                           "ANSI C: Just say no" -- Me



More information about the Comp.unix.xenix mailing list