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.
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.