Hi!
I would like to test a file and determine whether it is a Cshell, awk or other type of script. Scripts will often start with something like #!/bin/sh or #!/bin/nawk..
I did the following
set fd [open $file "r"]
gets $fd line
if [regexp {#!\/bin\/*awk} $line]
{
it's an awk or nawk or gnawk script
}
else
...
This does not seem to work. Does someone has some examples with regexp?
Thanks!
I would like to test a file and determine whether it is a Cshell, awk or other type of script. Scripts will often start with something like #!/bin/sh or #!/bin/nawk..
I did the following
set fd [open $file "r"]
gets $fd line
if [regexp {#!\/bin\/*awk} $line]
{
it's an awk or nawk or gnawk script
}
else
...
This does not seem to work. Does someone has some examples with regexp?
Thanks!