bd------bash编程--引用&命令替换

 

 

 

 

[root@node01 sh]# a=99
[root@node01 sh]# echo "$a"
99
[root@node01 sh]# echo '$a'
$a

 

[root@node01 sh]# echo $a
99
[root@node01 sh]# echo "99"
99
[root@node01 sh]# echo "\"99\""
"99"
[root@node01 sh]# echo "echo "sxt""
echo sxt
[root@node01 sh]# echo "`echo "sxt"`"
sxt

 

 

[root@node01 sh]# abc=$(echo $(ls "sxt"))
ls: cannot access sxt: No such file or directory
[root@node01 sh]# abc=$(echo $(ls /))
[root@node01 sh]# echo $abc
bin boot dev etc home jdk-7u67-linux-x64.rpm lib lib64 lost+found media mnt opt proc root sbin selinux share srv sys tmp usr var
[root@node01 sh]# aaa=$(echo $(echo ''xxx))
[root@node01 sh]# echo aaa
aaa
[root@node01 sh]# echo $aaa
xxx

 

 

 

 

 

 &&:有假为假

||:有真为真

 

posted @ 2019-10-04 20:04  ryuuku  阅读(213)  评论(0编辑  收藏  举报