コマンドの標準入力に文字列を渡す方法として Here Stringsがある。
$ cat <<< "test" test
この記法の注意点として必ず改行が含まれる。
The result is supplied as a single string, with a newline appended, to the command on its standard input
改行を含めたくなければ echo -n がてっとりばやい。
$ echo -n "test" | cat test$
コマンドの標準入力に文字列を渡す方法として Here Stringsがある。
$ cat <<< "test" test
この記法の注意点として必ず改行が含まれる。
The result is supplied as a single string, with a newline appended, to the command on its standard input
改行を含めたくなければ echo -n がてっとりばやい。
$ echo -n "test" | cat test$