- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shortcut to run a 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
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
тАО10-14-2008 08:12 PM
тАО10-14-2008 08:12 PM
shortcut to run a script
I am a new user to use HP-UX 11.11.
I want to ask got any shortcut to run a script instead of typed "sh" or "./" in front of the script name to run it ?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2008 08:23 PM
тАО10-14-2008 08:23 PM
Re: shortcut to run a script
I think this is already a shortcut to run a script.
Thanks
SKR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2008 08:41 PM
тАО10-14-2008 08:41 PM
Re: shortcut to run a script
depend on exactly what you want, but:
chmod a+x script_name
Then move (or copy) the script into a
directory on your PATH (or add its current
directory to your PATH). Details depend on
your shell, but perhaps something like:
mkdir ~/bin
cp script_name ~/bin
PATH="${PATH}:~/bin"
Then (depending on what's in the script):
script_name
should run the thing.
You could add "." to your PATH (instead of
"~/bin"), but that makes it easy to find
yourself running some local garbage instead
of the script you expected to be running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2008 08:42 PM
тАО10-14-2008 08:42 PM
Re: shortcut to run a script
It's almost never correct to say "only way".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2008 10:52 AM
тАО10-16-2008 10:52 AM
Re: shortcut to run a script
You can define an alias which is substituted with anything you want, including long and complex command lines. This way, you can reduce your frequently used commands to just a few characters, if you want.
Check out http://docs.hp.com/en/B2355-90046/ch18s02.html?btnPrev=%AB%A0prev
Cheers,
Wout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2008 11:01 AM
тАО10-16-2008 11:01 AM
Re: shortcut to run a script
Prepending "./" says 'find this file in my current directory'.
If you aren't the 'root' user, the '.' [current directory] is included in your PATH as the last choice. Hence, there is no need to specify anything but your execuatable's name.
Do *NOT* add '.' to root's PATH. This is a hugh security hole. You want to be sure you know what you are running and you don't want to easily and capraciously execute something you don't want to run merely because you typed (or mistyped) a command.
Regards!
...JRF...