Unix


To call an oracle stored procedure from shell script you have to use sqlplus

sqlplus -SILENT "user/pwd@sid" <<!
exec "myProc";

using the SILENT option on sqlloader does not output anything related to sqlloader. You only get an output saying the procedure has successfully completed (or any error messages pertaining to the code)

One of the ways to splitting a line in shell script is to use the IFS variable. This defines on what character to split the input. By default its space

Usage:
shell script

TEST="folder/filename";
# You want the filename part
IFS=/;
val="";
for i in $TEST
do
val=$i; # This stores the last value
done

echo $val; # This prints filename

If you want to get the name of the file only without the extension change the IFS to “.” and extract the first part of the name

This is as I found one of the ways. If there is any other way, please let me know.

One of the requirements of my task was to format the return value of `date` as YYYY-MM-DD format.

This is really simple.
In my shell script I wrote
echo `date +"%F"`
And the output came as 2008-09-29.

Doing a man or help on date will give you a list of all available options.

In LINUX, xmllint is a good tool for checking the syntax of an xml file.

Usage: xmllint filename
This shows if there are any errors in the xml like missing tags, tags not matching etc.

To format the xml in the branched way, use xmllint format
xmllint --format filename
This gives the formatted xml file.

To get the memory and CPU information on LINUX machine use the following commands on your command prompt:

cat /proc/meminfo
cat /proc/cpuinfo

You need not login as ROOT user for this