Are you sure that your script has done using ksh ? What is your SHELL variable value ?
1st line:
#!/bin/ksh
and execute flag is on ?
or run it using ksh
ksh script
---------- Post updated at 11:17 AM ---------- Previous update was at 11:14 AM ----------
Script without firstline #!programpath and execute flag is on and you give scriptname, then
script has done using variable SHELL value. Always programpath with correct options in the first line in scriptfile. Awk, sh, sed, perl, python, ...
As said, the < is just when using bash in this example.
Also as said, leave out the useless cat. The most tools can read files on their own and don't need it to be cat'ed & piped.
Use for ksh:
VAR=`awk 'NR == 4 {print $1}' infile`
echo ${VAR}
I changed to awk so you get rid of leading spaces this way.
Try it in your script and tell if it does not work.
cool that worked like charm.. i think i was just trying to understand why we are not able to use "|" in the SunOS. Anyways thanks for your help.. Thanks all
SunOS include same command many times, different version (many other *nix has same status).
There is own old binary = compatible, xpg4 spec version, u95 version, gnu, posix, ...
I think, if you try find, you'll find more than one ksh.
find / -name ksh
find / -name sed
Try | using with all those ksh.
---------- Post updated at 04:41 PM ---------- Previous update was at 04:39 PM ----------