LoginSignup
9
5

More than 5 years have passed since last update.

bash:変数への代入の仕方&ファイルの中身を取得する方法備忘録

Posted at

変数

コード

test.sh
#!/bin/bash

var="hello world"

echo "${var}"

実行

$ bash ./test.sh
hello world

ファイルの中身を取得する

読み込むファイル

test.json
{
  "test1":1,
  "test2":2,
  "test3":3
}

コード

test.sh
#!/bin/bash

var=`cat test.json`

echo "${var}"

実行

$ bash ./test.sh
{
  "test1":1,
  "test2":2,
  "test3":3
}
9
5
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
9
5