shell腳本練習(12.9)

查找/root/目錄下是否存在該文件


vim file.sh


#!/bin/bash

#written by lizheng

#about find file

echo "enter a file"

read a

if test -e /root/$a

then echo "the file is exist!"

else echo "the file is not exist!"

fi


spacer.gifwKioL1hLY6bgOihJAAAWb_1xlWU107.png-wh_50


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章