I am trying to make my first emacs package, that will control an Amatuer radio remotely. There is a command line tool called rigctl that can already do this. It can take to parameters. The first is always a letter, the second is usually a number (not a string).
I managed to find the shell-command-to-string when looking online. The problem is when I pass a number I have to convert the param to a string. I am struggling a bit to get this working as intended.
The printf %s was suggested as sometimes rigctl gets information back from the radio. This stops any newline’s being sent back to emacs.
The man page for rigctl is here
(defun rigctl (cmd param)
"Send command to rigctl"
(interactive)
(let (par (number-to-string param))
(shell-command-to-string (concat "printf %s $(" hamlib-rigctl-command " --model=" hamlib-rigctl-model " --rig-file=" hamlib-rigctl-rigfile " " cmd " " par ")"))))
Thank you in advance for your help