- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: script problem
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
Discussions
Discussions
Forums
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
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
тАО01-18-2006 10:56 PM
тАО01-18-2006 10:56 PM
script problem
when i create a script name is "test", after creation when i run the script, it always run ./test. please tell me why i need to give ./ for running. i am a root user and created thru root user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 10:59 PM
тАО01-18-2006 10:59 PM
Re: script problem
You either copy your script "test" in /usr/bin or add path of your test script to PATH.
# export PATH=$PATH:
This way you don't have to specify ./
Hope that helps.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 11:01 PM
тАО01-18-2006 11:01 PM
Re: script problem
Most likely $PATH does not contain "." (your home directory). For the root user, this is deliberate, as putting "." in root's PATH is considered a security risk.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 11:05 PM
тАО01-18-2006 11:05 PM
Re: script problem
put it in /usr/contrib/bin or /usr/local/bin
But then everybody can get it.
Otherwise give it a meaningful name and use the alias command to set the short name = fullpathname
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 11:15 PM
тАО01-18-2006 11:15 PM
Re: script problem
when you write "test", and do not get any error message, you actually execute a (standard) program named test.
"test" is normally located in /usr/bin and probably in yout path; therefor you do not get errors.
It is of course confusing to use a name like that.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2006 11:27 PM
тАО01-18-2006 11:27 PM
Re: script problem
If you want to start the script in the directory where it stand you need ./ to exucute ./ stand for current directory.
If you just want to start the script int has to stand in the directory which stand in PATH. You can see al these directory's by echo $PATH.
p.s. please give pionts to the one who helped. try to make it 29 0f 29 instead of.
I have assigned points to 8 of 29 responses to my questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2006 12:02 AM
тАО01-19-2006 12:02 AM
Re: script problem
Another bad idea is to make 'test' an alias or a shell-function :)
# which test
might give you that info
Enjoy, Have FUN! H.merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2006 01:54 AM
тАО01-19-2006 01:54 AM
Re: script problem
This reminds me of the very amusing rants of Damian Conway in his Perl Best Practices about unintelligent, unimaginative, lazy, lousy, poor, and evil variable names ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2006 02:52 AM
тАО01-19-2006 02:52 AM
Re: script problem
best practices:
Always do the ./scriptname thing when testing a new script. Recall a problem I once had where scp would not work because an application venderput its own script on the path with the name scp.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2006 05:25 AM
тАО01-19-2006 05:25 AM
Re: script problem
When you are developing a new script you can put it in a new subdirectory and add . as the first line in your PATH variable so it will search your current working directory first.
If in doubt use the which command to see if another program or script is in your path before the one you want.
H