【Linux Shell】判断输入变量或者参数是否为空
1.判断变量read -p "input a word :" wordif [ ! -n "$word" ] ;then echo "you have not input a word!"else echo "the word you input is $word"fi2.判断输入参数#!/bin/bashif [ ! -n "$1" ] ;then echo "you have not inpu
原创
2014-12-26 14:08:47 ·
1065 阅读 ·
0 评论