Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect options to script command #38

Open
ppslim opened this issue Sep 15, 2015 · 2 comments
Open

Incorrect options to script command #38

ppslim opened this issue Sep 15, 2015 · 2 comments

Comments

@ppslim
Copy link

ppslim commented Sep 15, 2015

Running Centos 6.6 I am unable to run the download, as invalid options are supplied to the script command.

$ curl showterm.io/showterm > showterm
$ sh showterm
showterm recording. (Exit shell when done.)
script: invalid option -- '/'
usage: script [-a] [-f] [-q] [-t] [file]

This is invoking script as script -q -t/tmp/1MIVy.timing /tmp/PZ4dl.script

$ script --version
script (util-linux-ng 2.17.2)
$ cat system-release
CentOS release 6.6 (Final)

The man page for script here indicates that -t will send timings to STDERR. It will not direct it to a file as the command being issued expects. Using the following solved this.

script $args -q -t "$scriptfile" 2>"$timingfile"

@ConradIrwin
Copy link
Owner

Unfortunately it looks like there are multiple different versions of script in the wild... When I wrote this gem I was testing with Ubuntu, so it works there. On OS X the -t flag specifies the interval between flushes :/.

Out of interest, do you have ttyrec installed on your system?

@victorbrca
Copy link

For older versions, the '-t' flag only outputs to std error (it does not output to a file).

A fix would be to output to std error and then redirect that to a file. It would work for both older and more updated versions of script:

script $args -q -t "$scriptfile" 2> "$timingfile"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants