
bashのhere-documentは一時ファイルを作成するらしい
皆さん使ってますか、here-document。bashでいうとこういう奴: cat <<EOF this is here document EOF 出力はこう: this is here document 複数行に渡るテキストをリテラルとして表現したい場合に便利ですね。で、shellscriptからREST APIにリクエストを投げたくて、here-documentを使ってJSONをべたっとスクリプト内で書いてたんですけど、こんなエラーが出てました(パスはもちろん違いますよ。念のため。): /path/to/shellscript/using/here-document.sh: line 179: cannot create temp file for here-document: No space left on device 全然知らなかったけど、here-documentって一時ファイルを作成するんですね。確かめてみます。 $ docker run -it --rm centos:7 bash [root@8017e5e28d6e /]# yum install -y strace (中略) [root@8017e5e28d6e /]# cat <<EOF > script.sh > cat <<EOS > foo > bar > baz > EOS > EOF [root@8017e5e28d6e /]# strace -f bash script.sh |& grep tmp [pid 61] stat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ....