File: prompt-prog.sh

package info (click to toggle)
pkcs11-data 0.7.3-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 1,496 kB
  • ctags: 36
  • sloc: sh: 9,174; ansic: 853; makefile: 49
file content (26 lines) | stat: -rwxr-xr-x 219 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

if [ "x$1" = "x-t" ]; then
	type="$2"
	shift 2
fi

echo -n "$1" >&2

case "$type" in
	text)
		read f
		echo $f
	;;
	password)
		stty -echo
		read f
		stty echo
		echo >&2
		echo $f
	;;
	none|*)
		:
	;;
esac