Linux Cron作业列线宽输出
我需要一点帮助:D 我有一个script.sh可以在控制台中正常工作,输出几乎每行140个字符/列 样本输出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
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