0

I am asking if there is a way to automatically put the output of a command into the middle of another.

multimon-ng outputs: ZCZC-WXR-TOR-029037+0030-1051700-KEAX/NWS and i want that output to get sent to where i put three question marks : python2.7 easencode.py -z ??? output.wav

can i do this with pipe and if so, how?

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227

1 Answers1

2

try

python2.7 easencode.py -z $(multimon-ng) output.wav

if you are in bash.

  • $( ) construct will execute command and insert result (stripped of end of line) in current command.

  • as per comment, you might whish to use "$( )" depending of expected result and importance of space.

Archemar
  • 31,183
  • 18
  • 69
  • 104
  • 2
    I'd usually quote it `"$(...)"` – pLumo Jun 18 '19 at 09:03
  • 3
    it's not about "the importance of space". if `multimon-ng` fails and doesn't print anything, then `output.wav` will be passed as argument to the `-z` option, resulting in a complete cock-up. –  Jun 18 '19 at 09:22
  • I was thinking about a more general use of `$( )` construction. – Archemar Jun 18 '19 at 10:03