LoginSignup
1
0

More than 1 year has passed since last update.

バッククォートの使用方法

Posted at

バッククォート(``) は、Linuxでは全く違う意味を持ちます。 シングルクォートは囲った中身を文字列として出力するのに対して、バッククォートは囲った中身をコマンドとして実行しその結果を出力します。

■使用例
$ echo "処理日:``date +%Y年%m月%d日`。"
処理日:2022年12月31日。

バッククォートの代用として「$()」も使用出来る。

■使用例
$ echo "処理日:$$(date +%Y年%m月%d日)。"
処理日:2022年12月31日。

Solarisでは「$()」上記が使用出来なかった。
バージョンによってだろうか、調査が必要。

1
0
2

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