Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Fix an annoying apropos glitch' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fix an annoying apropos glitch
Authored by: zs on Jan 21, '05 11:09:51PM
How about using something like:
cut -c1-`command that gets terminal width`
After some mucking around (using the "apropos" command, appropriately enough) I haven't found a command that can give me this information. Anyone know a way to do this?

---
zs

[ Reply to This | # ]

Fix an annoying apropos glitch
Authored by: zs on Jan 21, '05 11:12:56PM

Of course this isn't dynamic, but it should work at whatever the terminal width is before 'apropos' is executed. It seems that there is no perfect solution to this problem.

---
zs



[ Reply to This | # ]
shell width command
Authored by: gshenaut on Jan 22, '05 09:15:42AM
I think the -S flag is probably a better way to handle apropos, but you could alternatively use this (possibly somewhat fragile) cut command:
cut -c1-`stty all | head -1 | cut -d' ' -f6`

Greg Shenaut

[ Reply to This | # ]

shell width command
Authored by: perturb on Jan 25, '05 09:20:09AM
Less fragile stty:
stty size |cut -d' ' -f2


[ Reply to This | # ]