1行に複数のコマンドを実行する

1行に複数のコマンドを実行する

1行に2つのステップを実行したい。

twinkle  -c

それから

call  sip:[email protected] 

出力は次のとおりです。

ここに画像の説明を入力してください。

私はこれらの2つのステップを1行で実行したいので、and and andを試しました。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で実行されます。 ここに画像の説明を入力してください。

編集する私はそれをしようとし、しばらく動作し、自動的に閉じた(点滅をオフにしてbashに戻ります)。通話中は点滅し続ける必要があります。 printf %s\\n 'call sip:[email protected]' |twinkle -cここに画像の説明を入力してください。

ベストアンサー1

これを行うにはいくつかの方法があります。

twinkle  -c && call  sip:[email protected]

このオプションを使用すると、最初のコマンドがエラーなしで終了すると、2番目のコマンドが実行されます。それ以外の場合、2番目のエントリは実行されません。

twinkle  -c ; call  sip:[email protected]

この場合、最初のコマンドがエラーで終わるかどうかに関係なく、最初のコマンドの後に2番目のコマンドが実行されます。

修正する:私はあなたが次のようなものを探していると思います。

twinkle -c --immediate --call sip:[email protected]

~からtwinkleマニュアルページ:

--call <address>  
Instruct Twinkle to call the address. When Twinkle is already running, this will instruct the running process to call the address. The address may be a full or partial SIP URI. A partial SIP URI will be completed with the information from the user profile.
A subject may be passed by appending '`?subject=<subject>`' to the address.  
Examples: `twinkle --call 123456 twinkle --call sip:[email protected]?subject=hello`

--immediate
This option can be used in conjunction with `--call` or `--cmd` It indicates the the command or call is to be performed immediately without asking the user for any confirmation.

おすすめ記事