シェルスクリプトコマンドキー入力をリモートシェルに送信する

シェルスクリプトコマンドキー入力をリモートシェルに送信する

通常モードからインタラクティブモードに切り替えるときにスクリプトを実行できますか?

#/bash/bin  
sudo gatttool -b 80:EA:CA:00:00:03 -I  
# All these commands are typed in interactive mode  
connect  
while [ 1 ]; do  
char_read_hnd 0x0030 > a.txt  
done  
exit 1

ベストアンサー1

を探す

 sudo gatttool -b 80:EA:CA:00:00:03 -I  <<EOF
 # All these commands are entered in interactive mode  
connect  
while [ 1 ]; do  
char_read_hnd 0x0030 > a.txt  
done  
exit 1
EOF

文法cmd <<EOF(行)EOF(onw行にあります)をhereドキュメントと呼びます。

おすすめ記事