Listing 1: The getattr Script
#!/bin/ksh
# written by Steve Peterson, 11-94.
if (($# != 1))
then print "Usage: getattr devname"; exit; fi
lsattr -El $1 >/tmp/t1.$$
if (($? != 0)); then exit; fi
lsattr -Dl $1 >/tmp/t2.$$
diff -b /tmp/t1.$$ /tmp/t2.$$ | awk '
BEGIN {print "chdev \\"}
{if ($1 == "<") print "-a "$2"="$3" \\"}
END {print "-l "name}' name=$1
/usr/bin/rm /tmp/t[12].$$
|