HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: creating custom shell commands
Operating System - HP-UX
1833861
Members
2417
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-2003 05:05 PM
10-14-2003 05:05 PM
Hi,
I have created some shortcuts like
docs=`cd /web-root/web/jsp; pwd;` and placed in my .profile file.
Expecting if i type in docs, i will get changed to the directory desired,
Insted i get the following error
"sh: docs: not found"
Can any one help me.
Thanx,
Nag
I have created some shortcuts like
docs=`cd /web-root/web/jsp; pwd;` and placed in my .profile file.
Expecting if i type in docs, i will get changed to the directory desired,
Insted i get the following error
"sh: docs: not found"
Can any one help me.
Thanx,
Nag
Knowledge is Power
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2003 05:18 PM
10-14-2003 05:18 PM
Re: creating custom shell commands
For csh you can use alias
alias docs `ls /web-root/web/jsp`
For ksh/sh
$docs()
>ls /web-root/web/jsp
$alias docs='docs'
alias docs `ls /web-root/web/jsp`
For ksh/sh
$docs()
>ls /web-root/web/jsp
$alias docs='docs'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2003 05:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2003 05:27 PM
10-14-2003 05:27 PM
Re: creating custom shell commands
In the standard posix shell you can also use an alias as in
alias "myls=ls -l"
If you put these in your .profile they will be there every time you log in.
THe reason your commands are not being found is because the directory in which you put them is not specified in the PATH variable. The system looks throught his variable to find commands you type. You can look at this variable with "echo $PATH".
You have two choices, you can use the full path to your command when you run them like "/home/me/docs" or you can create a directory called scripts in your home directory and in your .profile do something like "export PATH=$PATH:/home/me/scripts". Put your scripts in this directory and everything should work.
alias "myls=ls -l"
If you put these in your .profile they will be there every time you log in.
THe reason your commands are not being found is because the directory in which you put them is not specified in the PATH variable. The system looks throught his variable to find commands you type. You can look at this variable with "echo $PATH".
You have two choices, you can use the full path to your command when you run them like "/home/me/docs" or you can create a directory called scripts in your home directory and in your .profile do something like "export PATH=$PATH:/home/me/scripts". Put your scripts in this directory and everything should work.
Never preceed any demonstration with anything more predictive than "watch this"
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP