The command scriptexecutes and writes logs.
script
( http://www.computerhope.com/unix/uscript.htm )
( http://linuxers.org/article/script-command-line-tool-recordsave-your-terminal-activity )
I use a command scriptto save commands and their output.
When you use the 'script', I print commands like the following.
$ script result.log Script started, file is result.log $ date $ ls -la. $ exit
Sometimes I want to use this command with a shell script.
So, I run as below.
$ script -c test.sh result.log
But the result .log has only output, it does not contain the command itself. I want result.log to include commands and output.
How can i do this?
thank
sh -x script, -x script.
script -c "sh -x ./test.sh" reult.log
:
+ date Tue Dec 23 09:52:22 CET 2014 + ls -la
set -o verbose
script script.
, .
, .
set -x or set -v set -xv
-x - , .
-v -o verbose,
-xv .
Source: https://habr.com/ru/post/1568715/More articles:не может создать папку с ожиданием script - shellLogstash does not start. Error: "Failed to start the TCP server: the address is used" - linuxShow pointer when passing by reference - c ++Java Spring app + Tomcat: JVM не создает дамп памяти - javaPython: equality for Nan on a list? - pythonDisplay Yes / no for Boolean in the API request parameter ReST - restManual focus with flash using camera Android2 - camera'ANDROID_BUILD_SDK_VERSION' Ошибка с помощью SDK для Facebook - androidhtaccess for multi-domain configuration: other domains do not work - redirectProtected folder in memory - androidAll Articles