LoginSignup
0
0

シェルスクリプト 初心者 備忘録

Posted at

シェルスクリプト if文

#!/bin/bash

name="${1}"
age="${2}"

if [[ "${name}" == "Taro" ]]; then
        echo "あなたの名前は太郎です"
elif [[ "${name}" != "Hanako" ]]; then
        echo "あなたの名前はHanakoではないです"
else
        echo "あなたの名前はHanakoです"
fi

[[スペース"${name}" == "Taro"スペース]]を入れる。
スペースを入れておらずエラーになったため些細なことだが投稿。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0