⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filetype2.sh

📁 Solaris环境下Shell编程编程
💻 SH
字号:
#!/bin/sh# Purpose: This script will determine whether the pathnames passed #          on the command line are a file or directory. Then it will#          print information about the pathname.## Scriptname: filetype2.shif [ $# -eq 0 ]; then	echo "Usage: filetype2.sh pathname [pathname2...]"	exit 1fiwhile [ $# -ne 0 ] do	if [ -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 special to say about file $1."	        fi	fi	shift	echo "\n\n"doneecho "Finished"

⌨️ 快捷键说明

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