0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[fish-shell] [03] 変数の値を正規表現で判定する

Last updated at Posted at 2021-09-18

概要

変数 FLG_DEBUG 変数が「true」,「TRUE」,「enable」,「ENABLE」,「1」の
いずれかであるかを "乱暴に" 判定する.

fish-shell V2.7.1 で動作確認済み.
 

#!/usr/bin/env fish

if test ( string match -r -i "\A[t|e|1]" "$FLG_DEBUG" )
  echo '多分 true, TRUE, enable, Enable, 1 のいずれかでしょう'
else 
  echo '不一致でした'
end

実際の運用ではきちんと判定しましょう...

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?