- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Unable to execute Shell Script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:09 AM
02-12-2007 06:09 AM
Unable to execute Shell Script
I'm in PA, connecting to an unix server in
NY with my id and able to execute following
script which has ,
#!/bin/ksh
echo "Script works"
Another team mate in MA, connecting to same unix server in NY with MY ID and NOT able to execute the same script.
getting " ksh: testingprg.sh: not found "
since he is using my id to login for same server, i dont think its a profile issue.
Can someone tell me what else to check.
PS: he is connecting to other unix servers (with his own ids) and same script works there.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:11 AM
02-12-2007 06:11 AM
Re: Unable to execute Shell Script
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:16 AM
02-12-2007 06:16 AM
Re: Unable to execute Shell Script
Perhaps your terminal emulator automatically appends the directory containing testingprg.sh to $PATH, while your colleague's emulator does not. If this is the case, note that the CWD (./) should NEVER be part of your path.
Also, /etc/profile or ~user/.profile could be setting paths differently based on originating host.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:16 AM
02-12-2007 06:16 AM
Re: Unable to execute Shell Script
I suggest that you have your colleague tell you EXACTLY what he enters to run your script.
Perhaps:
You do:
$ ./testingprg.sh
...but he/she does:
$ testingprg.sh
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:25 AM
02-12-2007 06:25 AM
Re: Unable to execute Shell Script
he is trying to execute the script from the
current directory. but where to set the path?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:33 AM
02-12-2007 06:33 AM
Re: Unable to execute Shell Script
he created sub dir
/export/home/usr9807/fortest and created a
script(testingprg.sh) with above said contents.
Now he executes from that sub dir as
/export/home/usr9807/fortest>testingprg.sh
and getting " ksh: testingprg.sh: not found "
when he tries to
/export/home/usr9807/fortest>/export/home/usr9807/fortest/testingprg.sh
IT WORKS ...
why should he provide full path ? how to set the path and where ?
Please help thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:35 AM
02-12-2007 06:35 AM
Re: Unable to execute Shell Script
This is typically done in /etc/profile and/or ~user/.profile.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:37 AM
02-12-2007 06:37 AM
Re: Unable to execute Shell Script
will work for him.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:42 AM
02-12-2007 06:42 AM
Re: Unable to execute Shell Script
inorder for him to execute as export/home/usr9807/fortest>testingprg.sh
instead of giving of full path ?
if thats the case why its working for me ?
for me this works
export/home/usr9807/fortest>testingprg.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:46 AM
02-12-2007 06:46 AM
Re: Unable to execute Shell Script
If you ARE logged in as root and you need to execute something the current directory - then just prepend the "." to it.
So, instead of running
# myscript
you'd run
# ./myscript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 06:59 AM
02-12-2007 06:59 AM
Re: Unable to execute Shell Script
But this is what i have currently.
# UNIX PATH specific
PATH=/usr/bin:/usr/local/bin:/usr/sbin:/usr/dt/bin:$OPENWIN/bin:$HOME/bin/:$PATH:.
i see ( . ) already at the end ..then it shud have worked right ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 07:07 AM
02-12-2007 07:07 AM
Re: Unable to execute Shell Script
But anyways, Is he connected to the right machine? KISS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 07:09 AM
02-12-2007 07:09 AM
Re: Unable to execute Shell Script
But anyways, Is he connected to the right machine? KISS
Is he in the directory where the script resides? Have him use the complete path.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 07:57 AM
02-12-2007 07:57 AM
Re: Unable to execute Shell Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2007 11:28 AM
02-12-2007 11:28 AM
Re: Unable to execute Shell Script
Man, my bad - I forgot that we had removed them all (".") when we did our server hardening. I can't believe I forgot that one - I'm just so used to typing "./" before things I wanted to run locally anyways for so many years as an admin - I never missed it when we removed it, as I had learned years and years ago not to depend on it.
Sorry for the bad advice, please ignore.