7.2. Xdm for X11R5   

On a raw X11R5 machine, it is more basic (it doesn't assume any specific Window manager such as Motif):

    #!/bin/sh

exec > $HOME/.xsession-errors 2>&1

case $# in
1)
case $1 in
failsafe)
exec xterm -geometry 80x24-0-0
;;
esac
esac

startup=$HOME/.xsession
resources=$HOME/.Xresources
if [ -f $startup ]; then
exec $startup

else
if [ -f $resources ]; then
xrdb -load $resources
fi
twm &
exec xterm -geometry 80x24+10+10 -ls
fi