The above code did not work for me. So, I started changing things up. The code below works for me using Brandmiester. The OS is the ASL distribution from about 3 months ago [ Linux KF5VH-AS0 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u2 (2019-05-13) x86_64 GNU/Linux ].
Put the script in /usr/local/sbin … I named the file “tgtune” . Then …
| # chmod +x tgtune
So, to change TalkGroup from the command shell to TG TAC-310 then TG 3122
| # tgtune 310
| # tgtune 3122
There is no error checking. No idea what happens if you feed it alpha characters.
You can write macros in rpt.conf to call shell scripts so users can change TGs.