1
heredocumentを使用してケルベロスのプリンシパルのリストを取得しようとしています。ここの文書の出力をテキストファイルにリダイレクトする方法は?
heredocumentの出力をテキストファイルにリダイレクトする方法を教えてください。 以下はテキストファイルへのリダイレクトなしのスクリプトの動作です。
#!/bin/bash
ssh [email protected] <<-EOF
kadmin.local
list_principals *host1*
EOF
output:
HTTP/[email protected]
hadoop/[email protected]
host/[email protected]
しかし、出力ファイルをテキストファイルにリダイレクトしようとすると、エラーが発生します。働いdin't
もの:
#!/bin/bash
ssh [email protected] <<-EOF > test.txt
kadmin.local
list_principals *host1*
EOF
output:
Pseudo-terminal will not be allocated because stdin is not a terminal.
#!/bin/bash
ssh [email protected] cat <<-EOF > test.txt
kadmin.local
list_principals *host1*
EOF
output:
kadmin.local
list_principals *host1*
、 '' -Tためssh' 'で-T'を使用する可能性があり擬似端末割り当てを無効にする。 – Inian