Re: [gentoo-user] Re: bash_history
On Sun, 19 Mar 2006 11:37:57 -0600, Octavio Ruiz (Ta^3) wrote: > You also want to set, > > export PROMPT_COMMAND="${PROMPT_COMMAND:+${PROMPT_COMMAND} ;} history -a" > > in cojuction with histappend. This results in PROMPT_COMMAND being set to "history -a; history -a" after using su. It is added for the initial login and again for the root login. However, "PROMPT_COMMAND="history -a" seems to work, as I don't use PROMPT_COMMAND for anything else. echo $PROMPT_COMMAND | grep -q history\ -a || export PROMPT_COMMAND... should take care of it in a more general case. -- Neil Bothwick Top Oxymorons Number 43: Genuine imitation signature.asc Description: PGP signature
Re: [gentoo-user] Re: bash_history
Tim Kruse, who happens to be smarter than you, thinks: > * On 18.03.2006 Neil Bothwick wrote: > > On Sat, 18 Mar 2006 10:17:19 +0100, Tim Kruse wrote: > > > >> Like you set all options in zsh ... > >> setopt INC_APPEND_HISTORY # incrementally append history to $HISTFILE > > > > Not that different from Bash then? :-) > > shopt -s histappend > > Do you mean the option itself or setting options? Setting > options is not so different in the most shells I think. > > If you mean the option itself then ... You also want to set, export PROMPT_COMMAND="${PROMPT_COMMAND:+${PROMPT_COMMAND} ;} history -a" in cojuction with histappend. -- It's not pretty being easy. pgpF0svi73nlX.pgp Description: PGP signature
Re: [gentoo-user] Re: bash_history
On Sun, 19 Mar 2006 09:18:58 +0100, Tim Kruse wrote: > You see the difference? :-P Yes. One up to zsh it would appear, there;'s no such option in Bash. -- Neil Bothwick Your lack of organisation does not represent an emergency in my world. signature.asc Description: PGP signature
[gentoo-user] Re: bash_history
* On 18.03.2006 Neil Bothwick wrote: > On Sat, 18 Mar 2006 10:17:19 +0100, Tim Kruse wrote: > >> Like you set all options in zsh ... >> >> setopt INC_APPEND_HISTORY # incrementally append history to $HISTFILE > > Not that different from Bash then? :-) > > shopt -s histappend Do you mean the option itself or setting options? Setting options is not so different in the most shells I think. If you mean the option itself then ... ,- | % man bash | col -b | grep -A 3 histappend | histappend | If set, the history list is appended to the file named | by the value of the HISTFILE variable when the shell | exits, rather than overwriting the file. | % | % man zshoptions | col -b | grep -A 5 APPEND_HISTORY | APPEND_HISTORY | If this is set, zsh sessions will append their history list to | the history file, rather than overwrite it. Thus, multiple par- | allel zsh sessions will all have their history lists added to | the history file, in the order they are killed. | | --- | INC_APPEND_HISTORY | This options works like APPEND_HISTORY except that new history | lines are added to the $HISTFILE incrementally (as soon as they | are entered), rather than waiting until the shell is killed. | The file is periodically trimmed to the number of lines speci- | fied by $SAVEHIST, but can exceed this value between trimmings. `- You see the difference? :-P So long, tkr -- What you don't know can hurt you, only you won't know it. signature.asc Description: PGP signature
Re: [gentoo-user] Re: bash_history
On Sat, 18 Mar 2006 10:17:19 +0100, Tim Kruse wrote: > Like you set all options in zsh ... > > setopt INC_APPEND_HISTORY # incrementally append history to $HISTFILE Not that different from Bash then? :-) shopt -s histappend -- Neil Bothwick WinErr 018: Unrecoverable error - System has been destroyed. Buy a new one. Old Windows licence is not valid anymore. signature.asc Description: PGP signature
[gentoo-user] Re: bash_history
* On 07.03.2006 Harry Putnam wrote: > I'd love it more if they bothered to tell you how to set this stuff. A second notice to that. 'man zshoptions' says it all. You even haven't to scroll down as it is all mentioned on the first page ... So long, tkr -- MSDOS didn't get as bad as it is overnight -- it took over ten years of careful development. -- [EMAIL PROTECTED] signature.asc Description: PGP signature
[gentoo-user] Re: bash_history
* On 07.03.2006 Harry Putnam wrote: > Tim Kruse <[EMAIL PROTECTED]> writes: > >> I love zsh ;-) >> >> ,- >> | % setopt | grep -i "append.*history" >> | incappendhistory >> | % man zshoptions | col -b | grep -A 4 APPEND_HISTORY >> | APPEND_HISTORY >> | If this is set, zsh sessions will append their history list to >> | the history file, rather than overwrite it. Thus, multiple par- >> | allel zsh sessions will all have their history lists added to >> | the history file, in the order they are killed. >> |-- >> | INC_APPEND_HISTORY >> | This options works like APPEND_HISTORY except that new history >> | lines are added to the $HISTFILE incrementally (as soon as they >> | are entered), rather than waiting until the shell is killed. >> | The file is periodically trimmed to the number of lines speci- >> | fied by $SAVEHIST, but can exceed this value between trimmings. >> `- > > I'd love it more if they bothered to tell you how to set this stuff. Like you set all options in zsh ... setopt INC_APPEND_HISTORY # incrementally append history to $HISTFILE So long, tkr -- A countryman between two lawyers is like a fish between two cats. -- Ben Franklin signature.asc Description: PGP signature
Re: [gentoo-user] Re: bash_history
> Tim Kruse <[EMAIL PROTECTED]> writes: > > > I love zsh ;-) > > > > ,- > > | % setopt | grep -i "append.*history" > > | incappendhistory > > | % man zshoptions | col -b | grep -A 4 APPEND_HISTORY > > | APPEND_HISTORY > > | If this is set, zsh sessions will append their history list to > > | the history file, rather than overwrite it. Thus, multiple par- > > | allel zsh sessions will all have their history lists added to > > | the history file, in the order they are killed. > > |-- > > | INC_APPEND_HISTORY > > | This options works like APPEND_HISTORY except that new history > > | lines are added to the $HISTFILE incrementally (as soon as they > > | are entered), rather than waiting until the shell is killed. > > | The file is periodically trimmed to the number of lines speci- > > | fied by $SAVEHIST, but can exceed this value between trimmings. > > `- > > I'd love it more if they bothered to tell you how to set this stuff. > > -- > gentoo-user@gentoo.org mailing list > Yes it would be lovely :), but I prefer bash. -- T - C o m - - W e b m a i l -- Ova poruka poslana je upotrebom T-Com Webmail usluge. T-Com te vodi na Svjetsko nogometno prvenstvo http://www.t-com.hr/naslovnica/nogomet/ -- gentoo-user@gentoo.org mailing list
[gentoo-user] Re: bash_history
Tim Kruse <[EMAIL PROTECTED]> writes: > I love zsh ;-) > > ,- > | % setopt | grep -i "append.*history" > | incappendhistory > | % man zshoptions | col -b | grep -A 4 APPEND_HISTORY > | APPEND_HISTORY > | If this is set, zsh sessions will append their history list to > | the history file, rather than overwrite it. Thus, multiple par- > | allel zsh sessions will all have their history lists added to > | the history file, in the order they are killed. > |-- > | INC_APPEND_HISTORY > | This options works like APPEND_HISTORY except that new history > | lines are added to the $HISTFILE incrementally (as soon as they > | are entered), rather than waiting until the shell is killed. > | The file is periodically trimmed to the number of lines speci- > | fied by $SAVEHIST, but can exceed this value between trimmings. > `- I'd love it more if they bothered to tell you how to set this stuff. -- gentoo-user@gentoo.org mailing list
[gentoo-user] Re: bash_history
Goran MaksimoviƦ <[EMAIL PROTECTED]> writes: > Yes, but is there someway that when i press ctrl-alt-del that before Linux > goes > in the process of reboot he previously log outs and then he goes in the > process > of reboot? I have not tried it but, for example my /etc/inittab has a line: ca:12345:ctrlaltdel:/sbin/shutdown -h now I am guessing that you could replace the shutdown command with a script of your own that does whatever you want, and then finally calls shutdown ? -- Simon Kellett,| Gentoo Linux, Fvwm, Firefox Darmstadt, Germany| Xemacs, Vm, Gnus -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] Re: bash_history
> On Tue, 2006-03-07 at 03:46 +0100, Tim Kruse wrote: > > * On 07.03.2006 Haim Ashkenazi wrote: > > > > >> I am wondering what do I need to config so that when a user or root > > >> type reboot the commands typed before a saved in bash_history and also > > >> when the user or root don' type anything but just press combination of > > >> keys ctrl+alt+del? > > > when you press reboot the shell process dies, so it doesn't save the > > > history. if you want to save history you have to exit the shell and the> n > > > login and enter reboot, or press ctrl+alt+del. > check out also the history command in bash ('help history'). it has some > commands to write or append the current history to a file (I never used > it, just looked at the man page). > > if it works you can have alias to 'history -a $HISTFILE > && /sbin/reboot'. of course you have to check the history options. > > Bye > -- > Haim > Yes, but is there someway that when i press ctrl-alt-del that before Linux goes in the process of reboot he previously log outs and then he goes in the process of reboot? Bye Goran -- T - C o m - - W e b m a i l -- Ova poruka poslana je upotrebom T-Com Webmail usluge. Postani redatelj najgledanijeg hrvatskog filma! http://www.tportal.hr/100sekundislave/ -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] Re: bash_history
On Tue, 2006-03-07 at 03:46 +0100, Tim Kruse wrote: > * On 07.03.2006 Haim Ashkenazi wrote: > > >> I am wondering what do I need to config so that when a user or root > >> type reboot the commands typed before a saved in bash_history and also > >> when the user or root don' type anything but just press combination of > >> keys ctrl+alt+del? > > when you press reboot the shell process dies, so it doesn't save the > > history. if you want to save history you have to exit the shell and then > > login and enter reboot, or press ctrl+alt+del. check out also the history command in bash ('help history'). it has some commands to write or append the current history to a file (I never used it, just looked at the man page). if it works you can have alias to 'history -a $HISTFILE && /sbin/reboot'. of course you have to check the history options. Bye -- Haim signature.asc Description: This is a digitally signed message part
[gentoo-user] Re: bash_history
* On 07.03.2006 Haim Ashkenazi wrote: >> I am wondering what do I need to config so that when a user or root >> type reboot the commands typed before a saved in bash_history and also >> when the user or root don' type anything but just press combination of >> keys ctrl+alt+del? > when you press reboot the shell process dies, so it doesn't save the > history. if you want to save history you have to exit the shell and then > login and enter reboot, or press ctrl+alt+del. I love zsh ;-) ,- | % setopt | grep -i "append.*history" | incappendhistory | % man zshoptions | col -b | grep -A 4 APPEND_HISTORY | APPEND_HISTORY | If this is set, zsh sessions will append their history list to | the history file, rather than overwrite it. Thus, multiple par- | allel zsh sessions will all have their history lists added to | the history file, in the order they are killed. |-- | INC_APPEND_HISTORY | This options works like APPEND_HISTORY except that new history | lines are added to the $HISTFILE incrementally (as soon as they | are entered), rather than waiting until the shell is killed. | The file is periodically trimmed to the number of lines speci- | fied by $SAVEHIST, but can exceed this value between trimmings. `- So long, tkr -- "There are some good people in it, but the orchestra as a whole is equivalent to a gang bent on destruction." -- John Cage, composer signature.asc Description: PGP signature