filetype.sh

来自「Solaris环境下Shell编程编程」· Shell 代码 · 共 39 行

SH
39
字号
#!/bin/sh # Purpose: This file will determine is the pathname passed on #          the command line is a file or directory. Then it will#          print information about the pathname.## Scriptname: filetype.shif [ $# -ne 1 ]; then	echo "Usage: filetype pathname"	exit 1fiif [ -d $1 ]; then	echo "$1 is a directory."	echo "Following is a listing of the $1 directory."	ls $1	echo " "	echo "The number of kilobytes used by directory $1 is: \c"	du -s -k $1 | nawk '{print $1}'else	echo "$1 is a file."	echo "The size of $1 in bytes is: \c"	ls -l $1 | nawk '{print $5}'	echo	if [ -b $1 ]; then		echo "$1 is s block special file."	elif  [ -c $1 ]; then		echo "$1 is s character special file."	elif  [ -u $1 ]; then		echo "$1 has the set-user-id permission."	else		echo "There is nothing sepecial to say about file $1."	fifiecho "Finished"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?