Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: "ckyim" <ckyim@netvigator.com>
Subject: script doesn't work in Digital
Date: 2000/04/07	[thread overview]
Message-ID: <8cku54$e5v4@imsp212.netvigator.com> (raw)

HI,


Q1.
The following script works in other Unix except Digital.
It is used for input one char with no need pressing 'enter'.

Anyone can help me to modify it to work in Digital :
readkey(){
oldstty=`stty -g`
stty -icanon -echo min 1 time 0
dd bs=1 count=1 <&0 2>/dev/null
stty $oldstty
}

echo "Enter a keystroke \c"
key=`readkey`
echo "\nkey is "$key


Q2.
I intend to trace each shell command line at shell prompt after excuted and
then do something :

=>      trap '<do something>' debug

But I found it can only work in writing simple command within '<do
something>'. I encounted the problem as below.
e.g  case 1.
      trap 'echo abc' debug  ----- if following input at shell prompt:
      $date          (works)
      $w | more     (works)

      case 2.
      trap 'date' debug ---- if following input at shell prompt:
      $date          (works)
      $w | more    (infinite wating more)


Thanks a lot if anyone can help me.

Regards,


yarsawelba@hongkong.com








                 reply	other threads:[~2000-04-07  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox