- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Links or Aliases Question...
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
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
тАО06-30-2000 08:35 AM
тАО06-30-2000 08:35 AM
vipw: Cannot obtain lock for /etc/.pwd.lock
". I can vi /etc/passwd by typing in exactly that, but I enjoyed vipw. I'm new to Unix and still learning...your help is appreciated. :-)
Thanks,
Garrin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2000 08:44 AM
тАО06-30-2000 08:44 AM
Re: Links or Aliases Question...
You can use .kshrc to setup your command aliases. (Eg: alias rm=`rm -i`)
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2000 08:58 AM
тАО06-30-2000 08:58 AM
Re: Links or Aliases Question...
Do you have set up the default shell as ksh? (see /etc/passwd file) or are you invoking the ksh shell under csh?
Is this for a regular user or for root? (vipw is a privileged command). And sh is the default for root?.
Anyway, check swlist for the following paches: PHCO_13363 sh.patch, PHCO_14084 csh patch, PHCO_16149 csh cumulative patch. (those patches are for HP-UX 11.0). I do have them installed and sh, csh, ksh are working just fine, including cd and vipw).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2000 09:12 AM
тАО06-30-2000 09:12 AM
Re: Links or Aliases Question...
***alias setprmt='PS1="
***[ $(/usr/bin/pwd) ]
***# "'
***setprmt
***alias cd=newcd
***function newcd
***{
*** cd "$@" >&- || return 1
*** setprmt
***}
Anyone got any clues?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2000 01:49 PM
тАО06-30-2000 01:49 PM
Re: Links or Aliases Question...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2000 07:29 PM
тАО06-30-2000 07:29 PM
Re: Links or Aliases Question...
So you can remove the /etc/.pwd.lock file (after checking that there are no other copies of vipw running. Use ps -ef|grep vipw
to locate any extra copies. Once the lock file is gone, vipw will work normally.
Next is the choice of csh, then ksh for the root user. Never use csh or ksh for the root user. Neither shell will function in single user mode. Use the POSIX shell /sbin/sh which is stored in library archive mode and will work in single user mode. The POSIX shell is built with ksh as the model so it is virtually the same as ksh.
AS far as creating a dynamic PS1 prompt that shows the current directory, it is much simpler to do. Just use the shell's built in variable $PWD as in:
export PS1='$PWD #'
Note the use of single apostrophes which will cause the prompt string to be evaluated every time. If " (double quotes) were used, the current value to $PWD would be assigned to PS1 and it would not change from prompt to prompt.
However, if you cd to a really low level directory like /opt/perl5/lib/5.00503/PA-RISC2.0/auto/Opcode, then your prompt will be really long. Using a ksh/POSIX shell construct, you can limit this to just the current and one level up as in:
export PS1='${PWD##${PWD%/*/*}/} #'
What this does is to extract the rightmost directory plus the next level up. Makes it easier to see local/bin versus contrib/bin.
For a really nice prompt string, use some terminal enhancements with:
IV=$(tput bold)
EE=$(tput sgr0)
HN=$(/usr/bin/hostname)
PS1='$HN $IV${PWD##${PWD%/*/*}/}$EE # '
The PS1 string is all one line in the above listing. If the inverse video is too much, just remove $IV in the PS1 string. This will show first the hostname then the directories.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2000 06:12 AM
тАО07-03-2000 06:12 AM
Re: Links or Aliases Question...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2000 09:04 AM
тАО07-03-2000 09:04 AM
Re: Links or Aliases Question...
If you are looking to use the POSIX shell, execute # /sbin/sh, or you can modify the /etc/passwd file and replace your current shell (at the end of the line that contains your user) with /sbin/sh. Logout, login and your shell will be /sbin/sh.
hope this answeres what you were asking!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2000 09:18 AM
тАО07-03-2000 09:18 AM
Re: Links or Aliases Question...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2000 01:19 PM
тАО07-05-2000 01:19 PM
Re: Links or Aliases Question...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2000 01:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2000 01:46 PM
тАО07-05-2000 01:46 PM
Re: Links or Aliases Question...
Specify /sbin/sh as teh root shell in /etc/passwd and then place your aliases and customized prompt in $HOME/.profile.
Personally, I set root's home to be /root so that it is protected against blowups of the /home filesystem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2000 01:51 PM
тАО07-05-2000 01:51 PM
Re: Links or Aliases Question...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2000 04:45 PM
тАО07-08-2000 04:45 PM
Re: Links or Aliases Question...
The POSIX shell is a superset of ksh (not quite but the differences are mostly esoteric) so everything you did in ksk usually works in POSIX shell. The differehnce is that .profile is the default so the START= statement is not needed and you can rename your .kshrc to .profile or merge the two if you like.
Bill Hassell, sysadmin