阅读背景:

shell小技巧(十九)判断文件是否是设备文件

来源:互联网 

代码:

#!/bin/bash 
if [ -z

代码:

#!/bin/bash 
if [ -z $1 ]; then
   read -p "please input device name:" x
else
   x=$1
fi
if [ -b $x -o -c $x ]; then
   echo "The $x is a device file!"
else
   echo "The $x is not a device file!"
fi
 

发布了53 篇原创文章 · 获赞 3 · 访问量 2万+

转载自blog.csdn.net/bigwood99/article/details/105116180 ]; then




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: