Chinaunix首页 | 论坛 | 博客
  • 博客访问: 30423
  • 博文数量: 6
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 42
  • 用 户 组: 普通用户
  • 注册时间: 2013-07-19 16:14
文章分类
文章存档

2014年(1)

2013年(5)

我的朋友

分类: 其他平台

2013-08-06 14:10:05

很苦恼的一个问题,检测Linux 下 /dev 下如果存在tty* 文件则退出判断

#! /bin/bash

filepath=/dev

while [ 1 ]
do
    ls /dev/tty*
    res=$?
    set -x
        #if [ -c $filepath/tty* ];then
     if [ $res -eq 0 ];then
    set +x
       echo "the tty* exist"
       break
    else
       echo "the tty* not exist...again..."
    fi
done
~   

这样做可以实现判断,但是为什么 用   #if [ -c $filepath/tty* ];不能判断呢?????? 真奇怪!

阅读(1969) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~