Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!hp4nl!htsa!maestro!jand From: jand@maestro.htsa.aha.nl (Jan Derriks) Newsgroups: comp.sys.hp Subject: Re: ksh (SECONDS or PS1) or COLUMNS bug Message-ID: <2766@maestro.htsa.aha.nl> Date: 26 Feb 91 12:21:12 GMT References: Sender: bin@htsa.htsa.aha.nl Distribution: comp Organization: AHA-TMF, Polytechnical Institute, Amsterdam, The Netherlands Lines: 42 In article kitano@corn.pa.yokogawa.co.jp (Kinichi Kitano) writes: - -I put a script in my .profile (from the book The Kornshell) - -$ cat .profile -. -. -export SECONDS="$(date '+3600*%H+60*%M+%S')" -typeset -z2 _h _m -_hh="(SECONDS/3600)%24" _mm="(SECONDS/60)%60" -_time='${_x[(_m=_mm)==(_h=_hh)]}$_h:$_m' -PS1="$(hostname) $_time "'[!] ' - -(This script prints the time of day.) - -And when I sourced my profile ( . .profile ), terminal hung. -This happend at every HP's (HP9000/800, HP9000/400. HP9000/300 from -$Revision: 56.4 to $Revision: 64.38.1.14 $ ) - -What is the problem? I think your PS1 exceeds the length in COLUMNS. We had this problem some time ago when my collegue tried a fancy way to set COLUMNS and LINES. Try this and ksh hangs: export COLUMNS PS1 PS1='waaaaaayyyyy toooo loooongggg > ' COLUMNS=10 I didn't get your script to work yet, but I have a strong suggestion the PS1 exceeds COLUMNS columns... Does anyone know if this is a known bug in ksh ? Jan Derriks PS: can anyone please fix the bugs in the 'MODEM DTR question' thread ? (I'm still waiting...) -- A chubby man with a white beard and a red suit will approach you soon. Avoid him. He's a Commie. Brought to you by Super Global Mega Corp .com