shell echo not appearing in cygwin?
I'm writing a shell script where I'm setting some variables, but I'd like to开发者_C百科 echo them to be certain they're correct. However I'm getting a blank line. Does anyone know why this happens because the syntax seems correct.
#!/bin/bash
set var='test'
echo $var
Since I'm on a windows machine I'm using cygwin to test my script.
Your script should be:
#!/bin/bash
var='test'
echo $var
set can be used to set shell attributes, not variables.
I used to get this issue on machines where I tried to upgrade cygwin. If you upgraded cygwin or installed additional components try reinstalling cygwin.
精彩评论