开发者

PHP exec() results in stripped lines/columns

开发者 https://www.devze.com 2023-03-07 23:36 出处:网络
I execute shell-scripts via PHP\'s exec() function. The res开发者_如何学Pythonult is then displayed. Executing dmesg works like a charm, however executing ps axu outputs lines that are cut at 80 chara

I execute shell-scripts via PHP's exec() function. The res开发者_如何学Pythonult is then displayed. Executing dmesg works like a charm, however executing ps axu outputs lines that are cut at 80 characters, like the following:

webservd   731  0.0  0.217812 5100 ?        S   May 19  0:00 /usr/php/bin/php-c
root       352  0.0  0.1 6344 3396 ?        S   May 19  0:10 /usr/lib/inet/ntpd

Any idea how I can avoid that width-restriction?

Thanks


Add the option w to ps to disable line clipping.


ps has output modifiers. You need one of these:

-w

Wide output. Use this option twice for unlimited width.

w

Wide output. Use this option twice for unlimited width.

Just add ww:

ps axuww
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号