LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 05-30-2011, 02:39 PM   #1
vaibhavs17
Member
 
Registered: Mar 2009
Posts: 49

Rep: Reputation: 1
shell script is defined in someother directory, how it is being invoked with path?


extract.ksh use this scripts topic_file_publish.sh but extract.ksh resides in
/data/apps/pnbos/scripts

but topic_file_publish.sh in below directory

/data/apps/pnbgstk/publication > ls topic_file_publish.sh
topic_file_publish.sh
fraespappp8:/data/apps > type topic_file_publish.sh
topic_file_publish.sh is hashed (/data/apps/pnbgstk/publication/topic_file_publish.sh)

how it is done?

since topic_file_publish.sh is being directly referenced in the code with absolute path.

Thanks,
Vaibhav
 
Old 05-30-2011, 10:47 PM   #2
tommyttt
Member
 
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Rep: Reputation: 34
Quote:
Originally Posted by vaibhavs17 View Post
extract.ksh use this scripts topic_file_publish.sh but extract.ksh resides in
/data/apps/pnbos/scripts

but topic_file_publish.sh in below directory

/data/apps/pnbgstk/publication > ls topic_file_publish.sh
topic_file_publish.sh
fraespappp8:/data/apps > type topic_file_publish.sh
topic_file_publish.sh is hashed (/data/apps/pnbgstk/publication/topic_file_publish.sh)

how it is done?

since topic_file_publish.sh is being directly referenced in the code with absolute path.

Thanks,
Vaibhav
An absolute path explicitly states the FULL path to the file (i.e. - /home/user/somedir/somescript). Is that what you mean?

Also, are you mixing shells (.sh is usually bash where .ksh is usually korn shell)

Tom
 
Old 05-30-2011, 11:24 PM   #3
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 659

Rep: Reputation: 160Reputation: 160
I draw your attention to:

Quote:
fraespappp8:/data/apps > type topic_file_publish.sh
topic_file_publish.sh is hashed (/data/apps/pnbgstk/publication/topic_file_publish.sh)
the `type` command clearly says that is hashed and seems to point to /data/apps/pnbgstk/publication/topic_file_publish.sh which is what you expect.

Some general points.
(1) which command will tell form which element in the path, the program is found.
(2) It all depends on the contents of the specific scrips which you haven't shared.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Shell Script - Use variable in a for loop with directory path Tech109 Linux - General 2 01-19-2011 11:22 AM
user defined input in shell script ovaisalam Linux - Newbie 4 12-08-2010 07:44 AM
help with glob - perl invoked from shell johngreg Programming 16 11-12-2008 04:33 PM
Shell script help: How to pass a directory path to the script? dv502 Programming 13 09-10-2008 04:07 AM
kill the process invoked from a shell script, when the script is killed kskkumar Linux - Software 8 05-23-2007 12:29 PM


All times are GMT -5. The time now is 11:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration