create an alias

create an alias that would generate a command prompt that was in the following form:   ebarnes! - /etc>        where ebarnes is the current username, is the current hostname, and /etc is the current directory.  cant type info..must be system generated.
should use backquotes.
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.
which shell are you using?
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.
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
ooppss typo...

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

also note that those are back tics around hostname and pwd not single quotes.

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.
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)
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.