Getting custom prompts to work under v1.3.1
Hello again. First off, I'd like to thank Mr. Pitts and Mr. Maze, who very kindly answered my previous mail. Now, (and a little more to the point :) here 0is my present dilemma: I have been a long time DOS user, and I'm quite accustomed to having a prompt with the path you're in, like this: C:\ And when one changes a directory, I'm used to seeing the prompt reflect that, like so: C:\cd apps C:\apps So I tried to do the same thing under linux. I edited my .bash_profile (which should give you an idea of what type of shell I'm using :) and added this: PS1=$PWD Because, after all, typing declare showed me that PWD was the variable for my current directory. I logged out, then back in (because source .bash_profile is starting to act funny on my system), and got a very nice prompt: /home/tlineman However, when I cd .., my prompt remained the same. When I typed source .bash_profile, my prompt changed and showed /home/ So now I assume that I have to have some type of replacement for cd that will do something like this: cd $* --(thanks Dave!) source .bash_profile Any suggestions? Tom P.S. Thanks to all who replied, but when I tried mounting my cdrom drive, I got an error message. Phooey. Browsing through /dev/ I decided to try sbpcd0. (In case you were wondering, I asked if a slave device on a primary IDE controller would be /dev/hdb) It worked when I mounted it, but I have really no idea why. (Not that I'm complaining, of course) Anyhow, would adding a line in /etc/fstab help me when I mount a file system not mentioned in there? Thanks. __ Get Your Private, Free Email at http://www.hotmail.com
Re: Getting custom prompts to work under v1.3.1
you're using bash? if you are go into the bash man page and search (that /) for ps1, here are all the bindings anyway, in your .bash_profile put export PS1=[some escape key sequences and some static chars] \a an ASCII bell character (07) \d the date in Weekday Month Date format (e.g., Tue May 26) \e an ASCII escape character (033) \h the hostname up to the first `.' \H the hostname \n newline \s the name of the shell, the basename of $0 (the portion following the final slash) \t the current time in 24-hour HH:MM:SS format \T the current time in 12-hour HH:MM:SS format \@ the current time in 12-hour am/pm format \u the username of the current user \v the version of bash (e.g., 2.00) \V the release of bash, version + patchlevel (e.g., 2.00.0) \w the current working directory \W the basename of the current working direc- tory \! the history number of this command \# the command number of this command \$ if the effective UID is 0, a #, otherwise a $ \nnn the character corresponding to the octal \\ a backslash \[ begin a sequence of non-printing characters, which could be used to embed a terminal so your basic prompt (from dos) is: export ps1\w$ --dave
Re: Getting custom prompts to work under v1.3.1
Try this: PS1=[EMAIL PROTECTED] This will give your user name followed by the @ then followed by the current working directory, which is ~ for $HOME. So, my prompt for my home directory looks like [EMAIL PROTECTED], and then say for a bin directory, [EMAIL PROTECTED]/bin]. -- ___ ___ __ _ _ __ |_ ) / -_) _` | ' \ / / \___\__, |_|_|_/___| |___/
Re: Getting custom prompts to work under v1.3.1
-BEGIN PGP SIGNED MESSAGE- On Mon, 30 Aug 1999, David Blackman wrote: so your basic prompt (from dos) is: export ps1\w$ i'd recommend the following instead: export PS1='\w\$ ' This will give the current working directory, followed by a $ if non-root or a # if root. In either case, a space will separate the prompt from your command. You may want to read the Bash Prompt HOWTO, which should be located in the /usr/share/doc/HOWTO/ directory if you have one of the doc-linux packages installed. - -- finger for PGP public key. -BEGIN PGP SIGNATURE- Version: 2.6.3ia Charset: noconv iQCVAwUBN8trOr7M/9WKZLW5AQECnQP9FBMB7LGnVm5uSR7XlbbVKKa9/9zc0WYk m0wzGZSP5/InJ9/ReqH48nvJ/dILYA5SHtDABwa32oFEDOf3a+f900boaKaYAlKi IeCJXoxJiwZp3LgceThnihH5bFyVJpFHS564YoTiGeLZv+QeoBJpmg4qqxaoNYRz QoQD7cy/iNU= =RJ2t -END PGP SIGNATURE-