#!/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 -z 检查输入是否为空

test ! -e $filename && echo" $filename is not exsit" && exit 0 # test -e  检查输入的文件是否存在

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  execute#检查文件是否 可执行

echo "The file name : $filename is a $filetype" #输出文件的类型

echo "And the permissions are :$perm" #输出文件的权限

最新文章

  1. Python单元测试和Mock测试
  2. Python socket超时
  3. 模块(modue)的概念:
  4. 组合数问题hdu5894
  5. java代码调用oracle存储过程
  6. linux学习建议
  7. css 串联选择器和后代选择器
  8. Eclipse配置安卓开发环境(解决SDK manager下载慢问题)
  9. Django设置TIME_ZONE和LANGUAGE_CODE为中国区域
  10. SVN global ignore pattern for c#
  11. 常用ARM指令集及汇编_破解
  12. 数据提交成功后如何避免alert被window.location.reload()影响
  13. BZOJ_2631_tree_LCT
  14. python--数据类型bytes
  15. MySql常用命令集Mysql常用命令5
  16. 【Mysql优化三章】第一章
  17. Codeforces 894B - Ralph And His Magic Field
  18. JavaScript学习(二)——深入学习js对象的原型与继承
  19. MD5加密--项目案例
  20. mysql中间件 -> Atlas简介&安装

热门文章

  1. python常用魔法函数
  2. BZOJ 2141 排队 (CDQ分治)
  3. js代码检测设备问题:为什么在移动端检测设备的时候会出现pc的页面
  4. C#基础知识之类和结构
  5. LOJ149 0/1分数规划
  6. SpringBoot+Shiro学习(七):Filter过滤器管理
  7. 在项目中使用 Maven 私服
  8. boost compressedPair
  9. 【Mybatis】Mybatis缓存
  10. Redis事件通知示例