So I want to record my bash interaction, which I know I can do with script, or ttyrec. Except I want one feature more than they have. Save input (i.e STDIN), and output (i.e. STDOUT) separately.
So something like (where I typed the first "Hello World!"), except of course script
takes one [file]
arg, not two:
user@pc:~$ script input.txt output.txt
Script started
user@pc:~$ paste > textfile.txt
Hello World!
user@pc:~$ cat textfile.txt
Hello World!
user@pc:~$ exit
Script done
So input.txt
looks like:
user@pc:~$ paste > textfile.txt
Hello World!
user@pc:~$ cat textfile.txt
user@pc:~$ exit
And output.txt
looks like:
Hello World!
exit
So I want a program like script
which saves STDIN & STDOUT separately. Since currently, this would be the normal output of script
(which I do not want, and need seperated):
Script started
user@pc:~$ paste > textfile.txt
Hello World!
user@pc:~$ cat textfile.txt
Hello World!
user@pc:~$ exit
exit
Script done
Does this exist, or is this possible?
Note the usage of paste
command, since I had considered filtering the ouput file based on user@pc:~$
, but in my case (as with paste
) this would not work.