Be more Solaris-friendly.

Submitted by:	Milan Cermak <Milan.Cermak@Sun.COM>
This commit is contained in:
Pawel Jakub Dawidek 2009-01-16 18:09:49 +00:00
parent af65d772a0
commit 092513dad4
2 changed files with 8 additions and 4 deletions

View File

@ -6,15 +6,19 @@ os=`uname`
case "${os}" in
FreeBSD|Darwin)
GREP=grep
#fs=`df -T . | tail -1 | awk '{print $2}'`
pattern="`df . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`"
fs=`mount | egrep "^${pattern}" | awk -F '[(,]' '{print $2}'`
;;
Solaris)
pattern="`df -k . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`"
fs=`mount -v | egrep "^${pattern}" | awk '{print $5}'`
Solaris|SunOS)
GREP=ggrep
pattern=`df -k . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`
fs=`mount -v | egrep "^${pattern}" | awk '{print $5}' | \
tr -s '[:lower:]' '[:upper:]'`
;;
Linux)
GREP=grep
fs=`df -PT . | tail -1 | awk '{print $2}'`
;;
*)

View File

@ -87,7 +87,7 @@ test_check()
todo()
{
echo "${os}" | grep -iq "${1}"
echo "${os}" | $GREP -iq "${1}"
if [ $? -eq 0 ]; then
todomsg="${2}"
fi