| 1 | .TH ushell 1 "20 April 1999" "Local tools" |
| 2 | .SH NAME |
| 3 | ushell \- display a user's shell |
| 4 | .SH SYNOPSIS |
| 5 | .B ushell |
| 6 | .I user |
| 7 | .SH USAGE |
| 8 | Writes the named user's default shell to standard output. This is |
| 9 | useful in scripts sometimes. In particular, it's handy in global |
| 10 | .B xdm/Xstartup |
| 11 | scripts for checking whether users have sensible shells: |
| 12 | .sp 1 |
| 13 | .RS 5 |
| 14 | .nf |
| 15 | .ft B |
| 16 | SHELL=`ushell $USER` |
| 17 | case $SHELL in |
| 18 | */banned) |
| 19 | xmessage -file $HOME/.banned |
| 20 | exit 1 |
| 21 | ;; |
| 22 | *) |
| 23 | if ! grep -q "^$SHELL" /etc/shells; then |
| 24 | xmessage "You're not allowed to log in this way." |
| 25 | exit 1 |
| 26 | fi |
| 27 | ;; |
| 28 | esac |
| 29 | .fi |
| 30 | .ft R |
| 31 | .SH BUGS |
| 32 | None planned. |
| 33 | .SH SEE ALSO |
| 34 | .BR banned (8), |
| 35 | .BR chrootsh (8). |
| 36 | .SH AUTHOR |
| 37 | Mark Wooding (mdw@nsict.org) |