Solved

changing shell prompt

Posted on 1998-12-17
7
249 Views
Last Modified: 2010-11-01
This is probably a fairly easy question, but how do I change a csh prompt so that it display the current directory (like DOS).  
0
Comment
Question by:mpenner
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Expert Comment

by:elfie
ID: 2008447
alias    cd      'cd \!*;set prompt="`pwd`> "'
set prompt="`pwd`> "
0
 

Author Comment

by:mpenner
ID: 2008448
That isn't going to work with something like pushd.  Isn't there some way to put something in the prompt environment variable to do this?


0
 
LVL 3

Expert Comment

by:elfie
ID: 2008449
The alias on is needed to change the prompt when doing a cd.

So if you use pushd, make the same kind of alias for pushd as well, just change 'cd' into 'pushd'




0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 2008450
NO thers is no way doing this in csh, use tcsh instead.

As elfie said, you have to make aliases for cd, pushd, popd, etc.
but keep in mind that theree are somee dragons to beet, like:
  cd
  cd ~
  cd ~user
  pushd +2
  cd to_a_mount_point
  cd to_a_link

Probably you check following to identify what you realy want to have:
   echo $cwd -- `pwd`; df .

0
 

Author Comment

by:mpenner
ID: 2008451
So how would I do it is tcsh?


0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008452
set prompt = '%/ '
see man tcsh for much more examples ;-)
0
 

Author Comment

by:mpenner
ID: 2008453
Thanks that is exactly what I wanted to find.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now