A
ashish.sachan
Hi i m just starign with PERL..given two problems to solve ..pls help
me in solving them
1. Develop a shell and a perl script to run on a Linux machine. The
script should
take a quoted string as one required argument and one more optional
argument as
a starting directory. Default starting directory will be "/" (the
root directory in
Linux) if the second argument is not provided to the script. The script
should
recursively go through all files under the directory, check the type of
file, and
only for files that are not directories or binary files, search the
file contents for the
quoted string (first argument to the script). The script should print
the "relative"
path of the files (relative to the directory - second argument or
default) in which
the string specified in the first argument is found.
2. Develop a shell and a perl script to print the process-id tree. The
script should take
one numeric value as argument. For example, if the script is run with
argument
12345, then the output should be a complete process tree showing the
process
having PID of 12345, its parent, grandparent, ... and also its child,
grandchild, ...
The output must show the PID, PPID and process name of each process in
the
process tree. Indented output for better readability is desired
me in solving them
1. Develop a shell and a perl script to run on a Linux machine. The
script should
take a quoted string as one required argument and one more optional
argument as
a starting directory. Default starting directory will be "/" (the
root directory in
Linux) if the second argument is not provided to the script. The script
should
recursively go through all files under the directory, check the type of
file, and
only for files that are not directories or binary files, search the
file contents for the
quoted string (first argument to the script). The script should print
the "relative"
path of the files (relative to the directory - second argument or
default) in which
the string specified in the first argument is found.
2. Develop a shell and a perl script to print the process-id tree. The
script should take
one numeric value as argument. For example, if the script is run with
argument
12345, then the output should be a complete process tree showing the
process
having PID of 12345, its parent, grandparent, ... and also its child,
grandchild, ...
The output must show the PID, PPID and process name of each process in
the
process tree. Indented output for better readability is desired