Hi Joe,
> Unfortunately the -w argument clips the text, it doesn't
actually wrap it
DId you provide a numeric argument to the "-w" option as specified in the man page? On mine, using Apple's Terminal, if I execute "ioreg" with no argument, it prints 79 characters of output for each line and a dollar sign, '$', in the 80
th column to indicate that truncation has occurred. (My terminal window is 80 characters wide) If I execute "ioreg -w 82", it produces 82 characters of output for each line. The 81
st character of is wrapped to the first character of the next line and a dollar sign follows that to indicate truncation. The output actually looks kind of cool; every other line consists of one character and a '$' character. If I execute "ioreg -w 0" I see the entire output for each line, each wrapped across two lines in the Terminal, and no dollar signs.
If I enlarge my Terminal window to a width of 81 characters, executing "ioreg -w 83" again produces one character of output and a '$' character on every other line. Executing "ioreg -w 0" again produces the entire output correctly wrapped after the 81
st character.
In all tests above, ioreg was both aware of the width of my Terminal window and wrapped the text exactly as I specified. The above tests produced the same results on my 10.4.2 system and a 10.3.8 system. Were your tests performed on the 10.4 system listed in your profile?
Were your failing tests performed in Apple's Terminal? The shell I used for these tests was zsh, my default shell. Were your failing tests performed in bash? If bash is somehow causing your ioreg to fail to function properly, then that could be the best argument yet for switching to zsh! To quote Bill Scott in
Why is my Default Shell 'tcsh'??:
Behold, for zsh is the only true shell. All others are false prophets.
Preach it, brother! and then
convert to it.
EDIT: Rats! On my system, "ioreg" functions correctly when used in bash, producing the same results I described above. Please forgive my disappointment but this could have provided significant fuel for our "zsh evangelism". Were you using Apple's Terminal? I'm running out of theories for why ioreg, which seems to have excellent terminal awareness and wrapping capability, is failing so miserably on your system!
--
Gary
~~~~
<SlayR> i just bought MS Office 2000 for only $20!!!
<Knghtbrd> you got ripped off ;>
<SlayR> i know 😉