Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ランダムな文字列を見つけるには、次の構文を使用する必要があることをフォーラムで読みました。
od -a -A n /dev/urandom | head -30 | tr -d ' ' | tr -d '\n' | awk '{print substr($0,1,256)}'
この出力を画面に表示する代わりに変数「var」に入れるにはどうすればよいですか?
バッククォートまたは を使用$()します。
$()
var=`command`
また
var=$(command)
バックティックでキャプチャします。``
VAR=`od -a -A n /dev/urandom | head -30 | tr -d ' ' | tr -d '\n' | awk '{print substr($0,1,256)}'`