I’m writing a shell script where I’m setting some variables, but I’d like to 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:
set can be used to set shell attributes, not variables.