linux commandでのクォーテーションによる動作の違いメモ

linux commandでのクォーテーションによる動作の違いメモ

今のunixtimeの表示

date +%s  

2秒ごとにコマンドを実行し、内容を確認できる

watch  

試す

とくになし

更新される

watch date +%s  

ダブルクォーテーション

更新される

watch "date +%s"  

ダブルクォーテーション+$()

更新されない

watch echo "$(date +%s)"  

シングルクォーテーション+$()

更新される

watch echo '$(date +%s)'  

linux commandでのクォーテーションによる動作の違いメモ
https://blog.hashito.biz/2021/12/01/d07556a9-261d-4925-8ad8-c43b9a2dc398/
著者
hashito
作成日
2021年12月1日
著作権