执行命令时
Annotation Processors
在Red Hat Linux命令行上,top -c -b -n | grep XXX > TEST
命令中的所有路径和其余内容都被导出到top
文件中(在一行中它写了超过100列/字符,例如)。
但是,当我在脚本中添加相同的命令并通过TEST
运行时,输出每次只有81列/字符。
如何在crontab
脚本中获取全宽信息?
答案 0 :(得分:1)
解释见man top
的第1部分:
-w :Output-width-override as: -w [ number ]
In Batch mode, when used without an argument top will
format output using the COLUMNS= and LINES= environment
variables, if set. Otherwise, width will be fixed at
the maximum 512 columns. With an argument, output
width can be decreased or increased (up to 512) but the
number of rows is considered unlimited.
In normal display mode, when used without an argument
top will attempt to format output using the COLUMNS=
and LINES= environment variables, if set. With an
argument, output width can only be decreased, not
increased. Whether using environment variables or an
argument with -w, when not in Batch mode actual termi‐
nal dimensions can never be exceeded.
Note: Without the use of this command-line option, out‐
put width is always based on the terminal at which top
was invoked whether or not in Batch mode.
当您启动它并调整其窗口大小时,终端会设置 COLUMNS
和LINES
。
答案 1 :(得分:0)