I used the following script to connect to my serial device using kermit:#!/usr/bin/kermitset port /dev/ttyUSB8set speed 115200set carrier-watch offset flow-control noneset prefixing allOUTPUT ifconfig\13But it throws the following error:bash: ./test.script: /usr/bin/kermit^M: bad interpreter: No such file or directoryI suspect that the path I give after the shebang could be the issue. How do I find the right path to get my script working?
Find the path of kermit directory to put after shebang (#!) in script
scripting;shebang;kermit
After the shebang you have the command to be executed. The script name will be the second argument. So in case of bash you have #!/bin/bash which is equivalent to call bash ./script.  In your case, the command is equivalent to:sudo /usr/bin/kermit ./test.scriptYou should check if kermit is installed and if it is in /usr/bin e.g. using the command which kermit.EDIT.Ah. now I found the error.You have a ^M (CR) on the first line. Go to the first line of script, remove the end of line and redo it. This in Unix/Linux.  DOS/Windows will add the ^M, which is not well interpreted.