I am trying to pipe some commands via echo to plink over serial comport to a linux device. Most short commands work, but when I combined with a linux command that needs a pipe character "|" it breaks. Which makes sense, since cmd or echo thinks its a cmd commands it is trying to pipe to. I tried using "^|" to escape the pipe character but its not working.
I tried:
echo ble_util | head -n 10 | plink -serial COM17 -sercfg 115200
'head' is not recognized as an internal or external command,
operable program or batch file.
Again, makes sense since cmd thinks I am trying to pipe into head...but then I try:
echo ble_util ^| head -n 10 | plink -serial COM17 -sercfg 115200
'head' is not recognized as an internal or external command,
operable program or batch file.
Same issue, only difference is that the control is not returned to cmd, I have to ctrl+c to be able to gain back control.
Then I tried:
echo ble_util ^| head -n 10 ^| plink -serial COM17 -sercfg 115200
ble_util | head -n 10 | plink -serial COM17 -sercfg 115200
And obviously that works.
Any ideas?
Thanks in advance!