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.
(l , d) - | rwx | rwx | rwx | 1 | sarala | 7 | 2010-10-20 03:40 | testfile |
(Symlink, directory) file | owner | group | Everyone else | links | owner | size | Modified date | File name |
chmod who=permissions filename (This gives “who” the specified permissions for a given filename.)
Permissions:
r | Permission to read the file. |
w | Permission to write the file. |
x | Permission to execute the file, or, in the case of a directory, search it. |
Letter | Meaning | ||
---|---|---|---|
u | The user who owns the file (this means “you.”) | ||
g | The group the file belongs to. | ||
o | The other users | ||
a | all of the above (an abbreviation for ugo ) |
MAKE - current make program name
$? - list of dependencies, can be used in target rules $@ - current target name, can be used in target rules $< - target prerequisite, can be used in target rules $* - name without suffix, can be used in target rules $% - name corresponding .o file, can be used in target rules @D - directory part of target name, can be used in target rules @F - file name part of target name, can be used in target rules $$va - make strips first $ and sends $va to shell, contents of var.
directory::
cd $@ && "$(MAKE)"
PHONY: clean
clean: rm *.o temp
|