0

Using multiple receivers to monitor HFDL traffic I'd like to create a start script for each of my receivers. The dumphfdl tool needs quite a few parameters. Besides specific parameters, the frequencies to monitor are given as a set of parameters.

Is it possible to put the frequencies in a text file and so feed them to the script?

Example of command line:

dumphfdl --soapysdr driver=sdrplay --freq-as-squawk \
    --sample-rate 2000000 --system-table /home/systable.conf \
    --system-table-save /home/systable.conf \
    2941 2944 2992 2998 3007 3016 3455 3497 3900 4654 4660 4681 4687 \
    --output decoded:basestation:tcp:address=127.0.0.1,port=60011

Desired command line:

dumphfdl --soapysdr driver=sdrplay --freq-as-squawk \
    --sample-rate 2000000 --system-table /home/systable.conf \
    --system-table-save /home/systable.conf 02M-04M.txt \
    --output decoded:basestation:tcp:address=127.0.0.1,port=60011

2 Answers 2

0

The standard solution would be xargs, but for this particular (and slightly pathological) case perhaps the simplest solution is

dumphfdl --soapysdr driver=sdrplay --freq-as-squawk \
    --sample-rate 2000000 --system-table /home/systable.conf \
    --system-table-save /home/systable.conf \
    $(cat 02M-04M.txt) \
    --output decoded:basestation:tcp:address=127.0.0.1,port=60011

... if I can correctly guess what it is that you are actually trying to ask.

The output of the $(command ...) command substitution is subject to whitespace tokenization and wildcard expansion, but if you have a file which simply contains tokens that you want to insert on the command line (and which don't contain shell wildcard characters etc) this should be reasonably robust and easy to understand.

For more information about the xargs solution, perhaps see also Linux command output as a parameter of another command

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much indeed, it's exactly what I needed!
0

If I understand you correctly, you want the list of frequencies in a file, and them to be expanded in the command line:

dumphfdl --soapysdr driver=sdrplay --freq-as-squawk \
    --sample-rate 2000000 --system-table /home/systable.conf \
    --system-table-save /home/systable.conf `cat 02M-04M.txt` \
    --output decoded:basestation:tcp:address=127.0.0.1,port=60011

Note the back quotes. That's assuming 02M-04M.txt contains the list of frequencies.

1 Comment

This simply repeats the accepted answer, only with obsolescent backtick syntax for the command substitution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.