Subject: Re: strange tab printing problem
To: None <netbsd-help@netbsd.org>
From: Jukka Salmi <j+nbsd@2006.salmi.ch>
List: netbsd-help
Date: 03/21/2006 17:44:52
--3V7upXqbjpZ4EhLz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

..and here's the script I forgot to attach...

Jukka Salmi --> netbsd-help (2006-03-21 17:42:57 +0100):
> Hi,
> 
> this is probably a bug somewhere in NetBSD, but since I have no idea
> where exactly it could be I post this message here...
> 
> Running the attached script should print some dots, followed by a tab,
> followed by "XYZ". However, on the -current NetBSD/i386 system I'm
> currently using, the tab is not printed. Actually, it doesn't matter
> how many tabs I print before "XYZ" with that last printf statement -
> none of them is output.
> 
> On a terminal window with 80 columns this looks as follows:
> 
> $ ./tab.sh
> ...............................................................................X
> YZ
> 
> Note that the 'X' follows the last dot; there's no tab in between.
> 
> In case this is not strange enough: if I use ssh(1) or telnet(1) to
> connect to the same host I'm already logged into, running the script
> suddenly works as expected:
> 
> $ telnet moray
> [...]
> $ ./tab.sh
> ............................................................................... 
> XYZ
> 
> 
> Hmm, any hints about what could be wrong?
> 
> TIA, Jukka
> 
> -- 
> bashian roulette:
> $ ((RANDOM%6)) || rm -rf ~

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

--3V7upXqbjpZ4EhLz
Content-Type: application/x-sh
Content-Disposition: attachment; filename="tab.sh"
Content-Transfer-Encoding: quoted-printable

#!/bin/sh=0A=0Asize=3D$(stty size) || exit=0Acols=3D${size#* }=0A=0Ai=3D1=
=0Awhile [ $i -lt $cols ]; do printf '.'; i=3D$(($i+1)); done=0A=0Aprintf '=
\tXYZ\n'=0A#        ^ this tab character is not printed!=0A
--3V7upXqbjpZ4EhLz--