-bash: ./qemu_inv.sh: /bin/bash^M: bad interpreter: No such file or directory
reason for that could be as following:
the ^M IS a carriage return character. Linux uses the line feed character to mark the end of a line,where windows uses the two-character sequence CR LF. The file has windows line endings, which is confusing Linux.
To remove the spurious CR characters, use following command:
sed -i -e 's/\r$//' [filename of script]