Advertisement
Guest User

Untitled

a guest
May 20th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. SCRIPT(1) BSD General Commands Manual SCRIPT(1)
  2.  
  3. NAME
  4. script -- make typescript of terminal session
  5.  
  6. SYNOPSIS
  7. script [-adkpqr] [-F pipe] [-t time] [file [command ...]]
  8.  
  9. DESCRIPTION
  10. The script utility makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment,
  11. as the typescript file can be printed out later with lpr(1).
  12.  
  13. If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript.
  14.  
  15. If the argument command is given, script will run the specified command with an optional argument vector instead of an interactive shell.
  16.  
  17. The following options are available:
  18.  
  19. -a Append the output to file or typescript, retaining the prior contents.
  20.  
  21. -d When playing back a session with the -p flag, do not sleep between records when playing back a timestamped session.
  22.  
  23. -F pipe
  24. Immediately flush output after each write. This will allow a user to create a named pipe using mkfifo(1) and another user may watch the live session using a utility like
  25. cat(1).
  26.  
  27. -k Log keys sent to the program as well as output.
  28.  
  29. -p Play back a session recorded with the -r flag in real time.
  30.  
  31. -q Run in quiet mode, omit the start, stop and command status messages.
  32.  
  33. -r Record a session with input, output, and timestamping.
  34.  
  35. -t time
  36. Specify the interval at which the script output file will be flushed to disk, in seconds. A value of 0 causes script to flush after every character I/O event. The default
  37. interval is 30 seconds.
  38.  
  39. The script ends when the forked shell (or command) exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-D (if ignoreeof is not set) for the C-shell,
  40. csh(1)).
  41.  
  42. Certain interactive commands, such as vi(1), create garbage in the typescript file. The script utility works best with commands that do not manipulate the screen. The results are
  43. meant to emulate a hardcopy terminal, not an addressable one.
  44.  
  45. ENVIRONMENT
  46. The following environment variables are utilized by script:
  47.  
  48. SCRIPT
  49. The SCRIPT environment variable is added to the sub-shell. If SCRIPT already existed in the users environment, its value is overwritten within the sub-shell. The value of
  50. SCRIPT is the name of the typescript file.
  51.  
  52. SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically).
  53.  
  54. SEE ALSO
  55. csh(1)
  56.  
  57. HISTORY
  58. The script command appeared in 3.0BSD.
  59.  
  60. The -d, -p and -r options first appeared in NetBSD 2.0 and were ported to FreeBSD 9.2.
  61.  
  62. BUGS
  63. The script utility places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects.
  64.  
  65. It is not possible to specify a command without also naming the script file because of argument parsing compatibility issues.
  66.  
  67. When running in -k mode, echo cancelling is far from ideal. The slave terminal mode is checked for ECHO mode to check when to avoid manual echo logging. This does not work when the
  68. terminal is in a raw mode where the program being run is doing manual echo.
  69.  
  70. If script reads zero bytes from the terminal, it switches to a mode when it only attempts to read once a second until there is data to read. This prevents script from spinning on
  71. zero-byte reads, but might cause a 1-second delay in processing of user input.
  72.  
  73. BSD December 4, 2013 BSD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement