u*******n 发帖数: 119 | 1 如果进行下面一步操作:
set a = "*"
echo $a
则将会出现该目录下所有文件名,而如何能将“*”本身赋值
给变量a,使echo $a显示的只是“*”,HOW TO DO THAT ? |
m*****e 发帖数: 4193 | 2 set a="'*'"
【在 u*******n 的大作中提到】 : 如果进行下面一步操作: : set a = "*" : echo $a : 则将会出现该目录下所有文件名,而如何能将“*”本身赋值 : 给变量a,使echo $a显示的只是“*”,HOW TO DO THAT ?
|
u*******n 发帖数: 119 | 3
spitfire 116: set a="'*'"
spitfire 117: echo $a
echo: No match
【在 m*****e 的大作中提到】 : set a="'*'"
|
d*****g 发帖数: 36 | 4 that's easy:
set a = '*'
(or set a = "*" )
echo "$a" <======= with " "
will display as:
*
【在 u*******n 的大作中提到】 : : spitfire 116: set a="'*'" : spitfire 117: echo $a : echo: No match
|
u*******n 发帖数: 119 | 5 hehe....
I want "echo $a" ----> *
Not just echo "*"----> *
如何能将“*”本身赋值给变量a,使echo $a显示的只是“*” ?
【在 d*****g 的大作中提到】 : that's easy: : set a = '*' : (or set a = "*" ) : echo "$a" <======= with " " : will display as: : *
|
c*****t 发帖数: 1879 | 6 Your question is unclear.
【在 u*******n 的大作中提到】 : hehe.... : I want "echo $a" ----> * : Not just echo "*"----> * : 如何能将“*”本身赋值给变量a,使echo $a显示的只是“*” ?
|
d*****g 发帖数: 36 | 7 hehe, I don't understand what you mean.....
You need to learn some basic of UNIX SHELLL ...
Please first learn the difference for following commands:
set a = "*" NOTE: please don't use: set a = *
1) echo $a
2) echo "$a"
I have to point out:
set a = '*'
set a = *
set a = "*"
are not the same.
if you use set a = *
you will always set a as current directory's files, not
character * ....
only use set a ='*' or set a ="*", just asign character * to
a
have you tried 2)?? it will j
【在 u*******n 的大作中提到】 : hehe.... : I want "echo $a" ----> * : Not just echo "*"----> * : 如何能将“*”本身赋值给变量a,使echo $a显示的只是“*” ?
|