Forum: Ruby on Rails Console truncates system call returns ....?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9ea8229b9b6503cde77171ffcfe2eedc?d=identicon&s=25 Sonny Chee (soroe)
on 2009-03-19 19:19
Hey Guys,

The following system call (in Ubuntu 8.04) gets the associated result.

$> ps aux | grep myProgram

1000     15152 59.2  1.3  33244 28652 pts/1    S    10:48   0:02 ruby
/home/workplace/fireknife/script/runner -e test  ARGV.push 1; require
'rating_profile.rb'; myProgram.new

However, when I attempt the following command in the console I get a
truncated result:

> res = `ps aux | grep 15152`

1000     15152 59.2  1.3  33244 28652 pts/1    S    10:48   0:02 ruby
/home/workpla\n

If I expand the terminal window, and re-execute in rails console, I get
more of the command string appearing. This isn't just a display issue,
since the following command in the rails console will yield an empty
result... unless the terminal window is expanded to its maximum width
*and* really small font...

> res = `ps aux | grep myProgram`

Is there a rails console configuration file I can adjust?  Any help
would be appreciated.

Sonny.
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2009-03-19 20:14
(Received via mailing list)
On Mar 19, 2009, at 2:19 PM, Sonny Chee wrote:
> However, when I attempt the following command in the console I get a
> since the following command in the rails console will yield an empty
> result... unless the terminal window is expanded to its maximum width
> *and* really small font...
>
>> res = `ps aux | grep myProgram`
>
> Is there a rails console configuration file I can adjust?  Any help
> would be appreciated.
>
> Sonny.
> --


No, but you could expand your options from aux to auxww or use --cols
--columns or --width options to set a width.

-Rob

Rob Biedenharn    http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
9ea8229b9b6503cde77171ffcfe2eedc?d=identicon&s=25 Sonny Chee (soroe)
on 2009-03-19 20:37
Thanks Rob, that did the trick!

Sonny.
This topic is locked and can not be replied to.