Skip to content

Instantly share code, notes, and snippets.

@sulincix
Created April 23, 2024 20:50
Show Gist options
  • Save sulincix/c225778874e357bd7a822d0530819e48 to your computer and use it in GitHub Desktop.
Save sulincix/c225778874e357bd7a822d0530819e48 to your computer and use it in GitHub Desktop.
minimal getty but bash script
#!/bin/sh
# minimal getty like script
# speed ignored.
# bgetty 38400 tty1 /bin/login
if [ $# -lt 3 ] ; then
echo "Usage: $0 [speed] [tty] [command]"
exit 1
fi
exec >/dev/$2
exec </dev/$2
exec 2>/dev/$2
shift 2
while true ; do
busybox setsid "$@"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment