Solution:
1. Use pargs argument (ex. ps -eaf | pargs -a
or
2. Use /usr/ucb/ps command ( /usr/ucb/ps -awwx | grep
These are some variables which are set internally by the shell and are available to the user:
$1 - $9 These variables are the positional parameters.
$0 The name of the command currently being executed.
$# The number of positional arguments given to this invocation of the shell.
$? The exit status of the last command executed is given as a decimal string.
When a command completes successfully, it returns the exit status of 0
(zero), otherwise it returns a non-zero exit status.
$$ The process number of this shell - useful for including in filenames, to
make them unique.
$! The process id of the last command run in the background.
$- The current options supplied to this invocation of the shell.
$* A string containing all the arguments to the shell, starting at $1.
$@@ Same as above, except when quoted.
Missing Module in array @INC
(use perl -e 'print join("\n", @INC);' to print the list of directories in @INC)
Errors like: Can't locate TimeDateNum.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.5/i86pc-solaris /usr/local/lib/perl5/5.8.5 /usr/local/lib/perl5/site_perl/5.8.5/i86pc-solaris /usr/local/lib/perl5/site_perl/5.8.5 /usr/local/lib/perl5/site_perl .) at ./test.pl line 5.
Solution:
We need to provide the missing module to perl. It can be done in the following ways.
1. Specify it in the PERL5LIB environment variable
export PERL5LIB="path of required module"
2. Use the -I option to specify the additional directories where it should search for modules while invoking perl.
perl -I "path of required module" script.pl
3. Modify your Perl program to find the module by adding the below line at the top of your program.
use lib "path of required module";
Perl adds this directory to it's @INC search list.
Option | Meaning | Example |
-e | Read the different sed command from command line. | $ sed -e 'sed-commands' data-file-name $ sed -e 's/test/TEST/' File $ sed -e |
-f | Read the sed command from sed script file. | $sed -f $ sed -f chgdb.sed friends.tdb |
-n | Suppress the output of sed command. When -n is used you must use p command of print flag to explicitly specify what is to be printed. | $ sed -n '/^\*..$/p' |
Syntax:
\{n,\m}
Matches any number of occurrence between n and m.
Example:
$ sed -n '/10\{2,4\}1/p' TestFile2
1001
10001
100001
Will match "1001", "10001", "100001" but not "101" or "10000000".
$ sed -n '/^\*..$/p' demofile2
***
***
Above command prints all lines that begins with *** (three stars or asterisks),
Explanation | |
^ | Beginning of line |
\* | Find the asterisk or star (\ remove the special meaning of '*' metacharacter) |
.. | Followed by any two character (you can also use \*\* i.e. $ sed -n '/^\*\*\*$/p' demofile2 ) |
$ | End of line (So that only three star or asterisk will be matched) |
/p | Print the pattern. |
Also the following expression can be used for the same purpose
$ sed -n '/^\*\{2,3\}$/p' TestFile2
Following command finds out lines between *** and *** and then delete all those line
$sed -e '/^\*\{2,3\}$/,/^\*\{2,3\}$/d' demofile2 > /tmp/fi.$$
$cat /tmp/fi.$$
Above expression can be explained as follows
Expression | Meaning |
^ | Beginning of line |
\* | Find the asterisk or star (\ remove the special meaning of '*' metacharacter) |
\{2,3\} | Find next two asterisk |
$ | End of line |
, | Next range or search pattern |
^\*\{2,3\}$ | Same as above |
d | Now delete all lines between *** and *** range |