Perl Script:
#!/usr/bin/perl5.8.8
$x = "the cat in the hat";
$x =~ s/(\w+)/reverse $1/ge;
OUTPUT:
$x contains "eht tac ni eht tah"
$x =~ s/(\w+)/reverse $1/ge;
OUTPUT:
$x contains "eht tac ni eht tah"
For a csh script, the first line is typically "#!/bin/csh -f". The "-f" option
tells the shell not to read the user's .cshrc file on startup, which improves
both speed and portability.
It's a common mistake to do the same thing for Bourne shell scripts by using
"#!/bin/sh -f". However, the Bourne shell's "-f" option is completely
different from csh's "-f" option. It disables file name generation. For
example, the following script:
#!/bin/sh
echo foo*
OUTPUT:
foo foo1 foo2 foo123
will print the names of all the files in the current directory whose names
begin with "foo" (or a literal "foo*" if there are no such files), but the
following script:
#!/bin/sh -f
echo foo*
OUTPUT:
foo*
will print a literal "foo*" unconditionally.
There are a number of Globus scripts that use "#!/bin/sh -f". It's possible
that this was deliberate, but unlikely. A quick look at the scripts indicates
that none of them use file wildcards anyway, so the "-f" probably has no
effect.
Suggestion: Replace "#!/bin/sh -f" with just "#!/bin/sh", just to avoid
confusion.
$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:0F:EA:91:04:07
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
In above example 192.168.1.2 is IP address of eth0 Ethernet interface.