Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: “basename $0” returns basename: -k: unknown option

Started 1 month ago by jaideepca
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
Site: LinuxQuestions.org - where Linux users come for help  LinuxQuestions.org - where Linux users come for help - site profile
Forum: Linux - Newbie  Linux - Newbie - forum profile
Total authors: 3 authors
Total thread posts: 7 posts
Thread activity: no new posts during last week
Domain info for: linuxquestions.org

Other posts in this thread:

catkin replied 1 month ago
Try Code: echo "DEBUG \$0: '$0'" before the call to basename to see if $0 has the value you think it has. There should be no space between $ and ( in $(<some command(s)>)

jaideepca replied 1 month ago
Same script and command working fine on RHEL4, but i am getting error in RHEL5. Thank You!

timmeke replied 1 month ago
@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?

jaideepca replied 1 month ago
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!

catkin replied 1 month ago
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?

jaideepca replied 1 month ago
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

 

Top contributing authors

Name
Posts
jaideepca
4
user's latest post:
“basename $0” returns...
Published (2009-11-09 06:30:00)
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
catkin
2
user's latest post:
“basename $0” returns...
Published (2009-11-09 05:26:00)
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?
timmeke
1
user's latest post:
“basename $0” returns...
Published (2009-11-06 09:23:00)
@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?

Related threads on "LinuxQuestions.org - where Linux users come for help":

Related threads on other sites:

Thread profile page for "“basename $0” returns basename: -k: unknown option" on http://www.linuxquestions.org. This report page is a snippet summary view from a single thread "“basename $0” returns basename: -k: unknown option", located on the Message Board at http://www.linuxquestions.org. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity