Post #42,785
6/18/02 2:52:20 PM
|
command that you ALWAYS run BEFORE init 0
hostname DOH!!! dropped a prod box. oooh, thanx, bill
TAM ARIS QUAM ARMIPOTENS
|
Post #42,826
6/18/02 7:53:38 PM
|
I've done that as well
I had just finished installing Solaris on a workstation and was in the midst of some post-install tweaking with multiple xterms connected locally and to other machines open.
I finished up and wanted to make sure the workstation came up properly so I found an xterm window with a generic root prompt and typed 'reboot'.
Turned out that I had lost track of which windows were connected to what and our production server was merrily heading down to init 6...
I don't think I ever sprinted down a flight of stairs so quickly.....
The only (small) point of pride I have about that incident is that I fessed up immediately and took steps to minimize the collateral damage.
Tom Sinclair "Subverting Young Minds Since 03/13/2000"
|
Post #42,832
6/18/02 8:16:23 PM
|
Re: command that you ALWAYS run BEFORE init 0
uhhhh
That's why I always have the short hostname in the prompt.... *GRIN*
I do believe most of us at one time or another did something STUPID!!!!
Mine was on an HP-UX 9.04 machine.
Was at the console in /usr thought I was in /u/gfolkert... oops
chmod -R 550 * ; chown -R gfolkert.users *
Next thing I did was call HP for support on how to get perms and owners back. Amazingly only had to run a "verify" script they quickly sent me. Evidently they distributed a 9.0x version with the /usr file system screwed up... About 1 hour lst time... although the COBOL systems still ran, printing didn't... they just queued up(in the COBOL pseudo spooler) until I fxed everything...
Gah! Since then I always have the current pwd in the prompt... *GRIN*
greg, curley95@attbi.com -- REMEMBER ED CURRY!!!
|
Post #42,838
6/18/02 9:21:01 PM
|
I use colours as well.
I'm just a user rather than an admin here at work - but hwen I login I have my config in my telnet client set up so that my dev server telnet session has a dark blue background, and the prod server telnet session is dark red. It's an easy way to tell which machine I'm working on.
Yes, it's telnet. Yes, I know it's bad. No, it doesn't seem to bother anyone else here.
On and on and on and on, and on and on and on goes John.
|
Post #42,976
6/20/02 12:43:14 AM
|
prompt attention
Set terminal title to user@host:directory. Set prompt to same. root's PS1 adds a highlight of the username. Execution is conditional on terminal type to prevent borkage. # Following sets prompt to [userid@host dir], and puts the full # user@host:/full/path/spec in an xterm title bar. function proml { case $TERM in xterm*|rxvt|eterm|wterm*) local TITLEBAR='\\[\\033]0;\\u@\\h:\\w\\007\\]' # eval `dircolors /etc/dir_colors` ;; *) local TITLEBAR='' ;; esac
case $TERM in linux|xterm*|rxvt|[Ee]term|wterm|screen*) alias ls='ls --color=auto' ;; *) ;; esac
# shell prompt PS1="${TITLEBAR}\\ [\\u@\\h:\\W]\\ \\$ " PS2='> ' PS4='+ ' }
if [ ! -z $PS1 ]; then proml export PS1 fi
-- Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com] [link|http://kmself.home.netcom.com/|[link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]] What part of "gestalt" don't you understand?
Keep software free. Oppose the CBDTPA. Kill S.2048 dead. [link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/...a_alert.html]]
|
Post #42,850
6/19/02 1:47:24 AM
|
more .bashrc
<snip> PS1='\\u@\\h:\\w\\$ ' This yields: peter@polonius:~$
Peter [link|http://www.debian.org|Shill For Hire] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Blog]
|
Post #42,854
6/19/02 2:08:58 AM
|
While we're comparing prompts...
I use:
EXPORT PS1='$PWD [$?] \\u@\\h \\$ '
I could use \\w instead of $PWD, I guess, but the ~ bothers me. Meanwhile, the $? is useful just often enough to leave it in there.
Wade.
"Ah. One of the difficult questions."
|
Post #42,958
6/19/02 10:54:18 PM
|
Re: While we're comparing prompts...
Never thought about displaying previous exit codes... That rocks. export PS1='$PWD [$?] \\u@\\h \\$ ' Gives me: /home/gfolkert [0] gfolkert@ren $ blahblah bash: blahblah: command not found /home/gfolkert [127] gfolkert@ren $ mkdir foo /home/gfolkert [0] gfolkert@ren $ touch foo/foofoo /home/gfolkert [0] gfolkert@ren $ rmdir foo rmdir: foo: Directory not empty /home/gfolkert [1] gfolkert@ren $ rm -f foo/foofoo /home/gfolkert [0] gfolkert@ren $ rmdir foo /home/gfolkert [0] gfolkert@ren $ I like it... prolly going to change a few things too.
greg, curley95@attbi.com -- REMEMBER ED CURRY!!!
|
Post #42,984
6/20/02 8:42:11 AM
|
It's one of those too-obvious things.
I had been doing some development with 4DOS batch files and caught myself typing echo $? so often I wondered why I couldn't put it in the prompt. Of course, I actually could, but it took me a few minutes to realize that! When I later picked up Linux and bash, I'd gotten used to it in my 4DOS prompts, so I put it in my bash prompts. Glad you like it.
Wade.
"Ah. One of the difficult questions."
|