LoginSignup
0
1

More than 3 years have passed since last update.

シェルスクリプト if 文記述例

Posted at

例1:

if-example1.sh
if [ "A" = "A" ]
then
  echo 'A'
fi

例2: 例1 から then を if の行に持って行った形。

if-example2.sh
if [ "A" = "A" ]; then
  echo 'A'
fi

例3: 例1 から echo を then の行に持って行った形。

if-example3.sh
if [ "A" = "A" ]
then echo 'A'
fi

例4: 全てを1行で書く形。

if-example4.sh
if [ "A" = "A" ]; then echo 'A'; fi
0
1
0

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
1