Actually I just tried that and it won't work for me unless it's a true executable. If I try to use a perl script it actually gets passed to bash for some reason.
Unless I'm doing something wrong of course...
[root@spoonbill root]$ cat /sbin/parser #!/usr/bin/perl while (<>) { print "line: $_"; } [root@spoonbill root]$ cat scr #!/sbin/parser this is my file
This works:
[root@spoonbill root]$ /sbin/parser scr line: #!/sbin/parser line: this line: is line: my line: file line:
This does not:
[root@spoonbill root]$ ./scr ./scr: line 2: this: command not found ./scr: line 3: is: command not found ./scr: line 4: my: command not found Usage: file [-bciknsvzL] [-f namefile] [-m magicfiles] file... Usage: file -C [-m magic]
(All run as root just in case there was a permission problem)
In reply to Re^3: Writing a parser
by Crackers2
in thread Writing a parser
by Zielony
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |