xref: /illumos-gate/usr/src/ucbcmd/df/df.sh (revision 60a3f738d56f92ae8b80e4b62a2331c6e1f2311f)
17c478bd9Sstevel@tonic-gate#!/usr/bin/sh
27c478bd9Sstevel@tonic-gate#
37c478bd9Sstevel@tonic-gate# CDDL HEADER START
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
6*60a3f738Srsb# Common Development and Distribution License (the "License").
7*60a3f738Srsb# You may not use this file except in compliance with the License.
87c478bd9Sstevel@tonic-gate#
97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate# and limitations under the License.
137c478bd9Sstevel@tonic-gate#
147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate#
207c478bd9Sstevel@tonic-gate# CDDL HEADER END
217c478bd9Sstevel@tonic-gate#
227c478bd9Sstevel@tonic-gate#
237c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
247c478bd9Sstevel@tonic-gate#
25*60a3f738Srsb# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
26*60a3f738Srsb# Use is subject to license terms.
277c478bd9Sstevel@tonic-gate#
287c478bd9Sstevel@tonic-gate# Replace /usr/ucb/df
297c478bd9Sstevel@tonic-gate#
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateARG=-k
32*60a3f738SrsbFSSPEC=N
33*60a3f738SrsbINODES=N
347c478bd9Sstevel@tonic-gate
35*60a3f738Srsbwhile [ $# -gt 0 ]
367c478bd9Sstevel@tonic-gatedo
377c478bd9Sstevel@tonic-gate	flag=$1
387c478bd9Sstevel@tonic-gate	case $flag in
39*60a3f738Srsb	'-F')
40*60a3f738Srsb		ARG="$ARG -F"
41*60a3f738Srsb		FSSPEC=Y
427c478bd9Sstevel@tonic-gate		;;
437c478bd9Sstevel@tonic-gate	'-t')
447c478bd9Sstevel@tonic-gate		ARG="$ARG -F"
45*60a3f738Srsb		FSSPEC=Y
467c478bd9Sstevel@tonic-gate		shift
477c478bd9Sstevel@tonic-gate		if [ "$1" = "4.2" ]
487c478bd9Sstevel@tonic-gate		then
497c478bd9Sstevel@tonic-gate			ARG="$ARG ufs"
507c478bd9Sstevel@tonic-gate		else
517c478bd9Sstevel@tonic-gate			ARG="$ARG $1"
527c478bd9Sstevel@tonic-gate		fi
537c478bd9Sstevel@tonic-gate		;;
547c478bd9Sstevel@tonic-gate	'-i')
55*60a3f738Srsb		ARG="$ARG -o i"
56*60a3f738Srsb		INODES=Y
577c478bd9Sstevel@tonic-gate		;;
587c478bd9Sstevel@tonic-gate	*)
597c478bd9Sstevel@tonic-gate		ARG="$ARG $flag"
607c478bd9Sstevel@tonic-gate		;;
617c478bd9Sstevel@tonic-gate	esac
62*60a3f738Srsb	if [ $# -gt 0 ]; then
637c478bd9Sstevel@tonic-gate		shift
647c478bd9Sstevel@tonic-gate	fi
657c478bd9Sstevel@tonic-gatedone
66*60a3f738Srsbif [ "$INODES" = "Y" ] && [ "$FSSPEC" = "N" ]; then
67*60a3f738Srsb	ARG="-F ufs $ARG"
68*60a3f738Srsbfi
69*60a3f738Srsbexec /usr/sbin/df $ARG
70