when to use double quotes with a variable in shell script?
I am in a confusion with what is meant by the double quotes referring to a variable. For example following two scripts gives the same output. What is really meant by the double quotes?
Script1
getent passwd | while IFS=: read a b c d e f ; do
echo login "$a" is "$d"
done
script 2
#! /bin/sh
getent passwd | while IFS=: read a b c d e f ; do
echo login $a is $d
done
I am in a confusion with what is meant by the double quotes referring to a variable. For example following two scripts gives the same output. What is really meant by the double quotes?
Script1
getent passwd | while IFS=: read a b c d e f ; do
echo login "$a" is "$d"
done
script 2
#! /bin/sh
getent passwd | while IFS=: read a b c d e f ; do
echo login $a is $d
done
No comments:
Post a Comment