aboutsummaryrefslogtreecommitdiff
path: root/1/test/test.sh
blob: 7dba0058e5ed08bdce4f58f12cc10e6e255315c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

if [ $(id -u) -ne 0 ] ; then
	echo "run me as root!" >&2
	exit 1
fi

if [ $# -eq 0 ] ; then
	echo "usage: $0 /dev/lork" >&2
	exit 1
fi

DEV="$1"
INPUT="test"

echo "input \"$INPUT\" to $DEV" >&2
echo "$INPUT" > "$DEV"
echo "(EC $?)" >&2

echo "output from $DEV:" >&2
cat "$DEV"
echo "(EC $?)" >&2

exit 0