This post was published more than 12 years ago. It's likely the contents are obsolete or nostolgic. If you think the contents are worth updating, open an issue. Otherwise, sit back and enjoy the stroll down memory lane.
The oh-so useful script command
So I wanted to do a bit of textual analysis on the results of a redis query. Naturally I thought I could pass a couple commands to redis-cli and redirect the results to a file. Well, as it turns out, redis-cli only takes one command. I needed at least two commands in order to get the relevant results. So, how can I get that file?
A coworker of mine turned me on to an often overlooked unix command typescript. Here’s how you use it:
$: script
... do whatever you need to ...
[ctrl-D]
The text results of whatever you did in between typing “script” and pressing ctl-D, should have been written to a file called “typescript” in your current directory.
Don’t you love it when there’s a command that does exactly what you want. Thanks to Mike for telling me about it!
See a mistake? Kindly let me know by filing an issue