[prog] check if script parent process is "init"

dominik schramm dominik.schramm at gmxpro.net
Wed Apr 21 08:35:35 EST 2004


Hi,

John Clarke <johnc+linuxchix at kirriwa.net> writes:

> > On the other hand, this would mean that init scripts can only be 
> > Bash scripts if rc itself is a Bash script (am I right?), which
> 
> Not true.  Any program can run a shell script:
> 
>     [johnc at dropbear ~/tmp]$ cat test.c
>     #include <unistd.h>
> 
>     int main(int argc, char *argv[])
>     {
>         execl("./test.sh", "test.sh", "1", "2", "3", NULL);
>         return 0;
>     }

I meant "Bourne shell" vs "Bourne again shell", like this:

$ cat caller.sh
#!/bin/sh
. callee

$ cat callee
#!/bin/bash
# contains bash specific syntax
...

My thought was that this couldn't work.
 
>> Could anyone using SuSE check?
> 
> Aren't you using SuSE?

Only at work. At home I want to relax and this works best with 
Debian. :-)

thanks for all the answers
dominik



More information about the Programming mailing list