Cover V04, I02
Article
Listing 1
Listing 2
Listing 3
Sidebar 1
Sidebar 2

mar95.tar


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].$$