Finding out how many spaces a tab character is expended to

Madison Kelly linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Sun Oct 28 21:52:38 UTC 2007


Hi all,

   I've got a silly question, but I can't seem to find the answer for it.

   A program of mine wraps text that is too long to display on one line
of a user's terminal. I use 'tput cols' to get the number of characters
per line, but I haven't been able to find out how many spaces a tab
character expands to.

   Is there an equivalent command to 'tput cols' for getting the number
of space a tab expands to? Currently I 'assume' 8 spaces, but I am sure
that is not always the case...

   Thanks all!

Madi

PS - It's a perl program, in case perl has a specific command.

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list