“basename $0” returns basename: -k: unknown option
Hi,
I am setting oracle Environment in one of my server(RHEL5). Below is the error i am getting. I am using kshell. Th=$" (basename $0) "--------returns basename: -k: unknown option basename: -s: unknown option basename: -h: unknown option Can any one help me to sort above problem. Thank you Jaidhe |
Try
Code:
echo "DEBUG \$0: '$0'" There should be no space between $ and ( in $(<some command(s)>) |
error
Same script and command working fine on RHEL4, but i am getting error in RHEL5.
Thank You! |
@jaideepca: please listen to senior members. If you're not here to take advice, then you're not in the right place.
I think catkin is on the right track: what is $0 set to? In other words, what is the name of your script? |
echo $'DEBUG $0: \'-ksh\''
After setting up DEBUG, getting below error.
+ echo $'DEBUG $0: \'-ksh\'' DEBUG $0: '-ksh' + basename -ksh -ksh: basename: -k: unknown option -ksh: basename: -s: unknown option -ksh: basename: -h: unknown option Usage: basename [ options ] string [suffix] Thanks! |
OK, so $0 contains -ksh. Your script shows you expected it to be a file name. How does $0 get its value? What is the name of your script and how are you calling it?
|
basename $0
Thanks catkin,
Below is the format . /u01/oracle/env -t test I am using RHEL 5 and using SHELL as kshell. echo $SHELL /usr/bin/ksh |
All times are GMT -5. The time now is 04:41 PM. |