- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Change Command Prompt to >
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
11-19-2002 06:33 AM
11-19-2002 06:33 AM
Currently is displays like this "hostname#"
i would like the display to show the full path like this.
"hostname:/var/spool/cron>"
Thanks
BB
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 06:31 AM
11-19-2002 06:31 AM
Re: Change Command Prompt to >
Try this:
hostname:$PWD>
Regards, Vicente.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 06:35 AM
11-19-2002 06:35 AM
Re: Change Command Prompt to >
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 06:37 AM
11-19-2002 06:37 AM
Re: Change Command Prompt to >
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 06:38 AM
11-19-2002 06:38 AM
Re: Change Command Prompt to >
export PS1="`hostname`:`pwd`> "
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 06:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 06:58 AM
11-19-2002 06:58 AM
Re: Change Command Prompt to >
this is how it looks now
--------------------------
PS1="$(hostname):\$PWD\>"
export HISTFILE PS1
#export PS1="$(hostname)# "
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 07:06 AM
11-19-2002 07:06 AM
Re: Change Command Prompt to >
You could comment out the old line, but if you don't think you will ever use it again, delete it.
I was taught shell scripting by the most intelligent person I've ever met in my life and one of the real computing wizards of our time. His philosophy was that a script (which a .profile is) should contain just exactly what it needs to run and it should look like it was written just to do what it is supposed to do, without a lot of commented out old lines, whether it is the first version or the fiftieth. I say, if you are done with it, clean it up. :)
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 07:08 AM
11-19-2002 07:08 AM
Re: Change Command Prompt to >
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2002 06:02 AM
11-20-2002 06:02 AM
Re: Change Command Prompt to >
export PS1="[ `hostname`:\${PWD} ] #"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2002 02:10 AM
11-21-2002 02:10 AM
Re: Change Command Prompt to >
If you want to repeat some or all of a command it is sometimes easier just to cut and paste it using the mouse, rather than using the command-line history. You will occasionally cut and paste the wrong text, due to clumsiness, without noticing. When you press ENTER, you issue an unintended command. Usually, the unintended command will be invalid, and no harm will be done. But if you use '>' in your prompt, the unintended command can be a valid command with redirection. You could accidently overwrite a file with garbage.
Using a # in your command prompt is better because # starts a comment, so pasting it accidently usually results in a truncated, invalid commmand.
I also recommend against including the name of the current working directory in your prompt. Including it seems popular and useful, but consider what happens if your current working directory is deep in a directory tree. The prompt will occupy most of the command line. Interpreting the text displayed in the command window will be much harder because commands are more likely to be split over several lines, and because the numerous repetitions of the long directory name are distracting.