- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- I cannot set PS1 prompt
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
06-15-2004 07:12 PM
06-15-2004 07:12 PM
I am so sorry for this question but I cannot find the problem. I cannot set the PS1 prompt.
app1:$USER:$PWD\#PS1="$(hostname):\$USER:\$PWD\#"
app1:$USER:$PWD\#export PS1
app1:$USER:$PWD\#
app1:$USER:$PWD\#uname -a
HP-UX app1 B.11.11 U 9000/800 1883809601 unlimited-user license
app1:$USER:$PWD\#id
uid=0(root) gid=3(sys) groups=0(root),1(other),2(bin),4(adm),5(daemon),6(mail),7(lp),20(users)
app1:$USER:$PWD\#echo $SHELL
/sbin/sh
but I can set another setting for PS1 like that
app1:$USER:$PWD\#PS1="$(hostname):\$PWD\#"
app1:/#
but I can set same settings for another host
app2:root:/#PS1="$(hostname):\$USER:\$PWD\#"
app2:root:/#cd /usr
app2:root:/usr#
I am using copy-paste from app2 to app1 to prevent syntax errors but still have problem
Have any idea?
Best Regards
Murat
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 07:27 PM
06-15-2004 07:27 PM
Re: I cannot set PS1 prompt
try export PS1='$PWD# '
(', not ")
Will work in ksh and posix shell.
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 07:36 PM
06-15-2004 07:36 PM
Re: I cannot set PS1 prompt
make entry in .profile file
export PS1='$PWD$'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 07:37 PM
06-15-2004 07:37 PM
Re: I cannot set PS1 prompt
First set hostname then add $USER followed by $PWD.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 07:39 PM
06-15-2004 07:39 PM
Re: I cannot set PS1 prompt
yes, it works but I want to set PS1 prompt like "hostname:user-id:pwd"
We are responsible for lots of host and working with several user accounts, so my desired settings will be very helpful
the app1 cannot sets up but the app2 sets successfully, these 2 hosts are identical (works as cluster nodes)
Best Regards
Murat SULUHAN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 07:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 08:01 PM
06-15-2004 08:01 PM
Re: I cannot set PS1 prompt
PS1=`uname -n`^'$LOGNAME:$PWD > '; export PS1
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 08:13 PM
06-15-2004 08:13 PM
Re: I cannot set PS1 prompt
app1:$USER:$PWD\#PS1="$(hostname):"
app1:PS1="$(hostname):\$USER:"
app1:$USER:
I think there is a problem with $USER variable, but I think $USER variable is built-in shell variable and don't needs to set up
When I set the $USER the PS1 works
app1:$USER:$PWD\#export USER=root
app1:root:/#
Have any idea?
Thanks for your response
Best Regards
Murat SULUHAN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 08:15 PM
06-15-2004 08:15 PM
Re: I cannot set PS1 prompt
I assumed your big problem was caused by " i.s.o ' and you would be able to figure out the rest. If you use " the $PWD will be evaluated only once and not when you type 'cd directory'.
You should be aware of special characters just behind a variable name. It's safer to use ${USER}.
You can do something like:
PS1="$(hostname):$(USER}:"'${PWD}#'
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 08:21 PM
06-15-2004 08:21 PM
Re: I cannot set PS1 prompt
Jose Maria and SAHA's solutions are working,
PS1="`hostname`:\$LOGNAME\$PWD\>"
PS1=`uname -n`^'$LOGNAME:$PWD > '; export PS1
Thanks for every response
Best Regards
Murat SULUHAN