educative.io

These commands don't seem to produce what's expected

MYGLOB=* # No quotes around the glob
echo $MYGLOB # Glob is interpreted
MYGLOB="" # Double quotes around the glob
echo “$MYGLOB” # Glob is not interpreted
MYGLOB=’
’ # Single quotes around the glob
echo “$MYGLOB” # Glob is not interpreted
echo ‘$MYGLOB’ # Variable is not interpreted
echo $MYGLOB # Glob is interpreted

If I do this on my mac shell:
MYGLOB=’*’ # Single quotes around the glob
echo “$MYGLOB”
and echo $MYGLOB are interpreted.

The shell that’s provided here gives different outputs but also doesn’t agree with what’s written.

Hi @haining.ren,
I hope you’re doing well.I’ve run the echo “$MYGLOB” and echo $MYGLOB in the provided terminal. Both are interpreted at my end.Please verify it from your end and let me know if it still does not work. Thank you!