<<< Date Index >>>     <<< Thread Index >>>

Re: wrap long lines



On Mon, Aug 28, 2006 at 12:46:00AM EDT, Kyle Wheeler wrote:
> This may not help you with your problem, but it may help explain some 
> stuff that appears to be "bizarre" behavior.
> 
> On Sunday, August 27 at 11:34 AM, quoth cga2000:
> >I did the following in a bash shell:
> >
> >$ export $COLUMNS
> >$ mutt 
> 
> Unless $COLUMNS evaluates to something like a variable name, that 
> first command will be interpreted as "export". You would have to do 
> something like:
> 
>     export COLUMNS
> 
> Note the lack of the $ in front of the variable name.
> 
> >:set wrapmargin="$COLUMNS-80"
> >
> >and mutt tells me:
> >
> >221-80: invalid value.
> 
> Because mutt doesn't recognize and evaluate mathematical expressions.
> 
> >This is likely not relevant but even though $COLUMNS is an environment
> >variable in my context.. I still had to add the export statement before
> >mutt was able to access its contents.
> 
> It's not an environment variable by default in the bash shell. It's 
> described in the man page in a section titled "Shell Variables", and 
> shell variables are not exported to the environment by default.

I knew most of the above "separately" but not well enough to put two and
two together.  One thing in particular that stumped me was that I did
not realize that mutt couldn't do arithmetic and needed some shell help.

I was pretty sure COLUMNS was an environment variable but I nevertheless
tested it issuing an "env" command .. not realizing that since I run
"permanent" shells under gnu/screen anything could have happened to that
particular shell since I last booted .. including an "export COLUMNS" ..

Did the same in a "fresh" shell and naturally COLUMNS wasn't listed.

The reason I assumed that it was an environment variable without having
given it too much thought .. was that I must have imagined that
full-screen apps such as Vim etc, used this together with LINES to
determine the underlying terminal's size.

As to my coding "export $COLUMNS" above .. that was a typo. ie. it's the
variable that you export, not its content.

Thanks.

cga