Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

create an alias

Posted on 1998-08-27
7
Medium Priority
?
430 Views
Last Modified: 2010-04-21
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.
0
Comment
Question by:javajava082798
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2006811
which shell are you using?
0
 
LVL 5

Expert Comment

by:n0thing
ID: 2006812
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
 

Author Comment

by:javajava082798
ID: 2006813
working in csh  and need the whole domain
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Accepted Solution

by:
cardell earned 400 total points
ID: 2006814
You could put the following in your .login file

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

That should do it.
0
 

Expert Comment

by:cardell
ID: 2006815
ooppss typo...

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

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

Expert Comment

by:bchew
ID: 2006816
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2006817
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question