create an alias

create an alias that would generate a command prompt that was in the following form:   ebarnes!jupiter.cs.uml.edu - /etc>        where ebarnes is the current username, jupiter.cs.uml.edu is the current hostname, and /etc is the current directory.  cant type info..must be system generated.
should use backquotes.
javajava082798Asked:
Who is Participating?
 
cardellConnect With a Mentor Commented:
You could put the following in your .login file

set prompt="$USER\\!hostname` - `pwd`>"

That should do it.
0
 
ozoCommented:
which shell are you using?
0
 
n0thingCommented:
What is your operating system ?? Your default shell ? csh ? bash ? sh ? ksh ??

Is ebarnes@jupiter - /etc> prompt oki for you ? Or you'll need the whole domain name ? Which is very hard to get depending on
the OS.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
javajava082798Author Commented:
working in csh  and need the whole domain
0
 
cardellCommented:
ooppss typo...

set prompt="$USER\\!`hostname` - `pwd`>"

also note that those are back tics around hostname and pwd not single quotes.
0
 
bchewCommented:
cardell,

This will only set the prompt correctly at login.  If the user changes directories then the prompt is no longer valid.  You would also have to alias the cd command to re-do the set each time it was executed.
0
 
ahoffmannCommented:
bchew is right, csh has no possibility to do this itself, you also must alias the cd,  pushd commands.
In tcsh you may use:
set prompt="$USER\\!`hostname` - %C%"

(assuming that hostname returns the fqdn)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.