bashによる引数の有無チェック


Warning: opendir(/home/ezic/ezic.info/public_html/w.ezic.info/wp-content/cache/db/2/singletables//48b/7ac): Failed to open directory: No such file or directory in /home/ezic/ezic.info/public_html/w.ezic.info/wp-content/plugins/w3-total-cache/Util_File.php on line 158

Warning: opendir(/home/ezic/ezic.info/public_html/w.ezic.info/wp-content/cache/db/2/singletables//12a/df1): Failed to open directory: No such file or directory in /home/ezic/ezic.info/public_html/w.ezic.info/wp-content/plugins/w3-total-cache/Util_File.php on line 158

以下の例は、第一引数がなかった際に処理をストップさせる

if [ "$1" = "" ];
  then
    echo 'Not argument, Please Enter!'
    exit;
fi
スポンサードリンク

コメント

タイトルとURLをコピーしました