shell脚本100例
判断文件或目录是否存在#!/bin/bashif [ $# -eq 0 ] ;thenecho “未输入任何参数,请输入参数”echo “用法:$0 [文件名|目录名]”fiif [ -f $1 ];thenecho “该文件,存在”ls -l $1elseecho “没有该文件”fiif [ -d $1 ];thenecho “该目录,存在”ls -ld $2elseecho “没有该目录”fi无密码登录虚拟机系统#!/bin/bash#该脚本使用 gues.
原创
2020-11-18 10:40:17 ·
3171 阅读 ·
0 评论