[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Wondering about the print out function of PS



Magicloud Magiclouds <magicloud.magiclouds@gmail.com> writes:

> On Tue, Nov 23, 2010 at 6:24 PM, Jochen Schulz <ml@well-adjusted.de> wrote:
>> Camaleón:
>>> On Tue, 23 Nov 2010 17:29:49 +0800, Magicloud Magiclouds wrote:
>>>
>>>> But I do not know how it gets the width of the screen.
>>>
>>> Well... gathering information about the running terminal is possible:
>>>
>>> sm01@stt008:~$ stty -a | grep column
>>> speed 38400 baud; rows 63; columns 86; line = 0;
>>
>> Or simply:
>>
>> $ echo $LINES $COLUMNS
>> 31 107
>>
>> (Don't know whether that's terminal/shell-specific.)
>
> $COLUMNS and $LINES are not in `env`, I cannot get it within my program.
>
I think I had similar problems but I got around it by exporting them in
my .bash_profile, so I just have:

  export LINES COLUMNS

-- 
Carl Johnson		carlj@peak.org


Reply to: