I am trying this option
#!/bin/ksh
echo $1
awk '{FS="=";print $2}' $1
and on the command line
test_sh INSTANCE=VIJAY
but awk is failing. Is there any problem here?
Basically I need the value VIJAY passed on the command line.
for awk, the second parameter is a name of the file to process.
So you asked it to process the file named INSTANCE=VIJAY
Instead, do
echo "$1" | awk '{FS="=";print $2}'
Just to be clear, what this does is pass the input to be processed to awk via standard input through a pipe from output of echo; instead of awk reading it input from a file.
To quote from Awk manual:
If there are no files named on the command line, gawk reads the standard input.