File: ppsfind

package info (click to toggle)
pps-tools 0.20120406%2Bg0deb9c7e-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 160 kB
  • ctags: 118
  • sloc: ansic: 815; makefile: 47; sh: 24
file content (17 lines) | stat: -rw-r--r-- 298 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

SYS="/sys/class/pps/"

if [ $# -lt 1 ] ; then
	echo "usage: ppsfind <name>" >&2
	exit 1
fi

for d in $(ls $SYS) ; do
	if grep $1 $SYS/$d/name >& /dev/null || \
	   grep $1 $SYS/$d/path >& /dev/null ; then
		echo "$d: name=$(cat $SYS/$d/name) path=$(cat $SYS/$d/path)"
	fi
done

exit 0