- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Prompt like msdos
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
03-13-2003 11:13 AM
03-13-2003 11:13 AM
How to make a prompt like msdos??? ex: hostname:\dir
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 11:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 11:18 AM
03-13-2003 11:18 AM
Re: Prompt like msdos
export PS1="`hostname` `pwd`# "
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 11:18 AM
03-13-2003 11:18 AM
Re: Prompt like msdos
Not a dumb question at all. We setup the prompt for root for all our boxes to display hostname:dir.
Try putting this in your .profile:
PS1=`hostname`:'$PWD > '
JP
P.S. At first I thought you were going to ask to change the prompt to C:> which would be funny!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 11:26 AM
03-13-2003 11:26 AM
Re: Prompt like msdos
I would vote much AGAINST having ">" in a prompt !
To be honest, I destroyed a rather important file once, by using cut&paste in a hurry and caused a wrong redirection.
"#" indeed is a very friendly character as a last one of a prompt, because if clipped and pasted by accident, it tells the shell to ignore the rest as a comment.
Yeah, life can be a hard thing, I will not tell here which one I zeroed out :-)
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 11:27 AM
03-13-2003 11:27 AM
Re: Prompt like msdos
/stand/vmunix
LOL
;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 11:33 AM
03-13-2003 11:33 AM
Re: Prompt like msdos
Ouch! We use the '#' prompt for root and '>' for other users, so at least we won't run into your problem as root.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 12:14 PM
03-13-2003 12:14 PM
Re: Prompt like msdos
and "$" for everyone else
here is another suggestion:
Set your PS1 so that it's like this:
username:hostname:dir$
for regular users and:
root:hostname:dir#
for root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2003 03:13 PM
03-16-2003 03:13 PM
Re: Prompt like msdos
however it is dumb using ">" in your prompt as an end.
try cut and paste and accidently picking up the > sign.
# > /etc/passwd
hmmm.... not a great idea
also in > indicates a continuation prompt.
such as $for x in `ls`
you get a > back
my 2 cents - and horrible experience - yes laugh!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2003 03:47 PM
03-16-2003 03:47 PM
Re: Prompt like msdos
'`
But the appearance of the character is 100% dependent on the character set used on the current display device. To make things really nasty, MS Word (by default) will change single quotes into open-close apostrophes thinking that this is plain text and not a scripting language. And imagine what it looks like on a fax (noise or a real tic mark?) More than a few sysadmins could not get a script to work because the grave accent is easily mistaken.
To use command substitution, recommended usage is $( command ). Not only is this much more readable but it it easily nested. So for the prompt:
PS1=$(hostname):'$PWD # '
Note that Unix convention for many years is to use # for a root prompt and $ for an ordinary user prompt, both are safe characters for an accidental copy-paste.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2003 05:04 PM
03-16-2003 05:04 PM
Re: Prompt like msdos
Better yet, make your PC's prompt look like unix:
http://www.suse.com/index_us.html
http://www.redhat.com
http://www.mandrakelinux.com/en/
(sorry if I missed a few - which I know I did - stressed for time)
It worked for me :-)
live free or die
harry