bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Saving command history for non-interactive shell


From: Lars Peterson
Subject: Saving command history for non-interactive shell
Date: Fri, 16 Mar 2012 14:33:35 +0000

Hello,

Is there a way to configure bash so that commands from a non-interactive shell 
are preserved in the history? I'm more interested in saving commands invoked 
via ssh vs shell scrpts. I did not succeed when trying a few things to "force" 
interactive mode such as:

# invoke bash as a login shell
ssh address@hidden "/bin/bash -lc 'echo test'"

# same thing, forcing a pseudo-tty (two "t" flags for good measure)
ssh -t address@hidden "/bin/bash -lc 'echo test'"
ssh -tt address@hidden "/bin/bash -lc 'echo test'"

The ideal solution would be to have a configuration set up so that the server 
would record history for any incoming ssh commands (and not have to craft the 
client side commands like above). Is this doable?

Thank you,

Lars Peterson







reply via email to

[Prev in Thread] Current Thread [Next in Thread]