unix变量赋值问题?求大神解答!
a=`db2 -x "select 5 from syscat.procedures fetch first 2 row only with ur " `
echo "$a"
b=`echo "${a}"|wc -l`
echo "$b"
执行结果:2
c=`db2 -x "select 5 from syscat.procedures fetch first 2 row only with ur "|wc -l`
echo "$c"
执行结果为:1
a=`db2 -x "select 5 from syscat.procedures fetch first 2 row only with ur " `
echo "$a"
执行结果为:5
5
echo`db2 -x "select 5 from syscat.procedures fetch first 2 row only with ur " `
执行结果为:5 5
为什么会有这样的差异?变量的赋值过程是怎么样的?
------解决方案--------------------方法C和方法D没有双引号,效果相同。