Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Cron作业列线宽输出_Linux_Console_Centos - Fatal编程技术网

Linux Cron作业列线宽输出

Linux Cron作业列线宽输出,linux,console,centos,Linux,Console,Centos,我需要一点帮助:D 我有一个script.sh可以在控制台中正常工作,输出几乎每行140个字符/列 样本输出 Effective port range: 1024-65535, Effective number of port blocks: 63504, Effective number of ports: 4064256, Max number of port blocks used: 43438, Current number of port blocks in use: 2074

我需要一点帮助:D

我有一个script.sh可以在控制台中正常工作,输出几乎每行140个字符/列

样本输出

Effective port range: 1024-65535, Effective number of port blocks: 63504, Effective number of ports: 4064256,
    Max number of port blocks used: 43438, Current number of port blocks in use: 20749, Port block allocation errors: 0
问题是当作为Cron作业执行时,输出显示/限制为80个字符/列,我不知道该怎么做,因为我已经尝试了所有方法

COLUMNS=999
fold -w200
fmt -w200
我还为脚本添加了路径,但似乎没有任何效果

脚本将输出保存为如下所示的txt文件(每小时):

00****/some/path/script.sh someIP>/other/path/output.txt
ip=1美元
期待
00 * * * * /some/path/script.sh someIP > /another/path/output.txt


ip=$1
expect <<EOF
  spawn ssh user@$ip
  expect "*:*"
  send "password\r"
  expect "*>*"
  send -- "show services nat pool|match \"Effective number\"|no-more\r"
  expect "*>*"
  send -- "show services nat pool detail|match \"Current number\"|no-more\r"
  expect "*>*"
  send -- "quit\r"
EOF