Bash Shebang
|
|
|
Comments (2)
that is interesting. could you share some examples?
i assume you already checked args[0] (or whatever the equivalent is in perl) and its value is "splitmake" and not the name of the script calling splitmake?
if that's the case then i suspect that the value is replaced in the chain of processing these scripts because i would have expected the name from the commandline script to be there, just like in a regular script the value is the name of the script and not of the interpreter.
greetings, eMBee.
i assume you already checked args[0] (or whatever the equivalent is in perl) and its value is "splitmake" and not the name of the script calling splitmake?
if that's the case then i suspect that the value is replaced in the chain of processing these scripts because i would have expected the name from the commandline script to be there, just like in a regular script the value is the name of the script and not of the interpreter.
greetings, eMBee.
Post a comment
A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.
Your message:Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help
Sign up and post (it is free) or Log in and post

...Or to anything capable of interpreting the file's contents. I've set up executable RC-files for text conversion where the shebang line calls out a Perl script I wrote, and the process works just fine: the RCfile's shebang line, "#!/usr/local/bin/splitmake" (plus args, including a self-reference) invokes splitmake, a script with a shebang line of "#!/usr/bin/perl -w", and the script's args get passed to the Perl interpreter just fine. The one tricky part I found is that, as noted, "splitmake" needs a commandline-option specifying the name of the RCfile it's supposed to read in and use.
That's just with messing around because I wanted to see if it would work, in the time it took to bring this project up. Somebody with some serious time to kill might discover how to get that calling program's path/name passed; maybe it's in the ENV.