script コマンド
script makes a typescript of everything on your terminal session. The terminal data are stored in raw form to the log file and information about timing to another (optional) structured log file. The timing log file is necessary to replay the session later by scriptreplay(1) and to store additional information about the session.
terminal session を記録してテキストで共有する際に便利
手順書とか
記録を始める前にシェルのプロンプトをシンプルにしたい
公開情報は少ない方がいい
おしゃれプロンプトには環境情報が載りがち
script コマンドが対応していない動きをして typescript が壊れる
ついでに自分の環境にしかないエイリアスなんかも消したい
Linux
script -c 'unset PS1; BASH_SILENCE_DEPRECATION_WARNING=1 bash --norc'
Mac
script typescript bash -c 'unset PS1; BASH_SILENCE_DEPRECATION_WARNING=1 bash --norc'
-c オプションがないので環境変数を操作するために bash を多段で実行するパターン
BASH_SILENCE_DEPRECATION_WARNING=1 script typescript bash --noprofile --init-file <(echo 'unset PS1')
環境変数を外側から与えてやるパターン