Script (Unix)The script command is a Unix utility that records a terminal session. It dates back to the 1979 3.0 Berkeley Software Distribution (BSD).[1] UsageA script session is captured in file name The recorded format of Problems with script commandOne of the problems with the script command is that it only allows logging of a child process; and often there is a need to log the command in the current process without spawning a new process, such as when automation of a script is needed that can log its own output. The Unix operating systems make this possible by use of pipes and redirects. Consider the following model examples: Bourne shellAll shells related to Bourne shell ( LOGNAME="script"
rm -f $LOGNAME.p $LOGNAME.log
mknod $LOGNAME.p p
tee <$LOGNAME.p $LOGNAME.log &
exec >$LOGNAME.p 2>&1
The above script records to Alternatives to script commandThe ttyrec program from 2000 provides the same kind of functionality and offers several bindings. The timing is similar to util-linux. A more modern take on the concept is "asciicast" JSON, used by asciinema.[5] See alsoReferences
|
Portal di Ensiklopedia Dunia