Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active November 19, 2024 05:18
Show Gist options
  • Save kjunichi/c62b590ab483ad35bd0367986404053b to your computer and use it in GitHub Desktop.
Save kjunichi/c62b590ab483ad35bd0367986404053b to your computer and use it in GitHub Desktop.

シェルスクリプト

コマンド置換

コマンド置換ではコマンド実行による出力をそのまま文字列に展開

func1() {
 echo "abc"
 return 0
}

str=$(func1)
echo $str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment