1行で実行したい2つのステップがあります。
twinkle -c
その後
call sip:[email protected]
出力は次のとおりです。
私は、1本のライン上のこれらの2つの手順を実行したかった私が試したtwinkle -c && call sip:[email protected]
とtwinkle -c call sip:[email protected]
とtwinkle -c ; call sip:[email protected]
とtwinkle -c --immediate --call sip:[email protected]
しかし、それらはすべてこの応答を与えます:
それらを同じラインに乗せる方法はありますか?
編集:2番目のコマンドはTwinkleではなくbashで実行されています:
編集私はprintf %s\\n 'call sip:[email protected]' |twinkle -c
1秒間動作してから、それ自体を閉じる(きらめきを閉じてbashに戻る)ことを試しました。通話中はきらめきのままである必要があります。
twinkle
stdinを受け入れてコマンドを実行していると思います。そう...
printf %s\\n 'call sip:[email protected]' | cat - /dev/tty |twinkle -c
...should hopefully do it. If, instead, twinkle
is one of those that reads /dev/tty
explicitly, you can probably do...
printf %s\\n 'call sip:[email protected]' | cat - /dev/tty |
luit -- twinkle -c
...or use perhaps script
or screen
in place of luit
.
Since the former method apparently works for you, the following shell function might make it more simple to run at the command line. You should note, though, that both of the methods in this answer are kind of hacks - I originally wrote this then deleted it after the other answer was edited to include --call
. I only undeleted it hours later when comments on the other indicated it wasn't working and I thought this might yet help. If it were me, though, I would try to find out why the other answer doesn't work.
Still, the shell function:
twinksip() while [ -n "$1" ]
do printf 'call sip:%s\n' "$1" |
cat - /dev/tty | twinkle -c || return
shift;done
...これは、call sip:
すべての引数の前にプレフィックスを付加し、それらをtwinkle
'sstdinに出力します。それはあなたがそれを与えるのと同じ数の引数を順番に処理します、それは私が推測するように、連続して多くの呼び出しをします-最後のものが終わるときに次を始めます。
次のようなプロンプトから呼び出します。
twinksip [email protected]
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加