getty replacement

Daniel O'Connor doconnor at gsoft.com.au
Tue Jul 5 12:45:09 GMT 2005


On Tue, 5 Jul 2005 20:15, Marcin Jessa wrote:
> That unfortunatelly does not seem to work.
> I tried a shell script with a read -p "Blah blah"  my_choice
> which should wait for an execution but this did not work either giving me
> exactly the same message... _______________________________________________

I believe your getty program has to open the tty that init passed it.

I suspect stdin is redirected to /dev/null by init for your program so the 
read exits.

I just tried this and it works fine..

#!/bin/sh

logger "Got these args $*"
while [ $# -gt 1 ]; do
  if [ -z "$args" ]; then
    args=$1
  else
    args="$args $1"
  fi
  shift
done
tty=$1

logger "tty is $tty"
logger "other args are $args"
echo "Hello there" >/dev/$tty

sleep 600

Note that the TTY name is last in the argument list.


-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20050705/331f383d/attachment.bin


More information about the freebsd-current mailing list