Skip to main content
expand
Source Link
Thomas Dickey
  • 79.3k
  • 9
  • 189
  • 290

If you really want to, you could make a program (or shell script) which calls script writing to a timestamped "typescript" file (and in turn calling your real shell) and make that program your default shell in /etc/passwd.

There are a few pitfalls:

  • you may have to add this program to /etc/shells
  • doing this sets the SHELL environment variable, which is used in various ways. Override that to avoid loops (and other misbehavior):
 #!/bin/sh SHELL=/bin/bash export SHELL script -c "$SHELL" $HOME/consoleOutput_$(whoami)_$(date +'%Y_%m_%d_%H_%M_%S_%N').txt 

If you really want to, you could make a program (or shell script) which calls script writing to a timestamped "typescript" file (and in turn calling your real shell) and make that program your default shell in /etc/passwd.

If you really want to, you could make a program (or shell script) which calls script writing to a timestamped "typescript" file (and in turn calling your real shell) and make that program your default shell in /etc/passwd.

There are a few pitfalls:

  • you may have to add this program to /etc/shells
  • doing this sets the SHELL environment variable, which is used in various ways. Override that to avoid loops (and other misbehavior):
 #!/bin/sh SHELL=/bin/bash export SHELL script -c "$SHELL" $HOME/consoleOutput_$(whoami)_$(date +'%Y_%m_%d_%H_%M_%S_%N').txt 
Source Link
Thomas Dickey
  • 79.3k
  • 9
  • 189
  • 290

If you really want to, you could make a program (or shell script) which calls script writing to a timestamped "typescript" file (and in turn calling your real shell) and make that program your default shell in /etc/passwd.