Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Masterxilo/91c0c393d97b928f02d3eefad0456a25 to your computer and use it in GitHub Desktop.
Save Masterxilo/91c0c393d97b928f02d3eefad0456a25 to your computer and use it in GitHub Desktop.
#!/bin/bash
# add the following line to the end of ~/.bashrc
# adapted from https://unix.stackexchange.com/a/25725/266802
# logs are created in ~
test "$(ps -ocommand= -p $PPID | awk '{print $1}')" == 'script' || (script -f $HOME/$(date +"%Y-%m-%d_%H-%M-%S")_shell.log)
@Masterxilo
Copy link
Author

with this you have to type exit twice

append
; exit

@Masterxilo
Copy link
Author

( script ... ; exit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment