summaryrefslogtreecommitdiff
path: root/tests/bin/modinfo
blob: 14a43bbbebcbdd79eb903485605ce5ddfe4e770d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

while [ $# -gt 0 ]; do
	case "$1" in
		-k)
			shift
			kver="$1"
			;;
		-F)
			shift
			field="$1"
			;;
		*)
			if [ -n "$field" ]; then
				awk -v field="$field:" '$1==field {print $2}' "$1"
			else
				cat "$1"
			fi
			;;
	esac
	shift
done