The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Article Feedback - Changing your bash prompt
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 Why 5 lines? No need for case.
Author: Matthew Dickinson 
Date:   07-03-05 19:59

there is no need for the case statement in that script. all five lines can be duplicated with one line:

PS1="[\u@\h:\w]\$ "

the \$ will put a # for uid = 0 and a $ for all others automatically. this is mentioned in the article but the author does not use this method.

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 Why 5 lines? No need for case.   new
Matthew Dickinson 07-03-05 19:59 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org