首页 > 系统服务 > 详细

test命令-linux shell 脚本

时间:2019-07-19 10:49:34      阅读:92      评论:0      收藏:0      [点我收藏+]

#!/bin/bash

# This is program will check you file name,which sys has or not,end print types.

#2019/07/19  FSQ

First release

echo -e "input file name:" filename

read filename

test -z $filename && echo "please input a file name" && exit 0

test ! -e $filename && echo" $filename is not exsit" && exit 0

test -d $filename && filetype="regulare file"

test -f $filename && filetype="directory"

test -r $filename && perm="readable"

test -w $filename && perm="$perm writeable"

test -x $filename && perm="$perm 

echo "The file name : $filename is a $filetype"

echo "And the permissions are :$perm"

test命令-linux shell 脚本

原文:https://www.cnblogs.com/fsq-mysql/p/11211842.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!