avatar
如何显示出“*”# Unix - 噫吁兮,危乎高哉
u*n
1
如果进行下面一步操作:
set a = "*"
echo $a
则将会出现该目录下所有文件名,而如何能将“*”本身赋值
给变量a,使echo $a显示的只是“*”,HOW TO DO THAT ?
avatar
m*e
2
set a="'*'"

【在 u*******n 的大作中提到】
: 如果进行下面一步操作:
: set a = "*"
: echo $a
: 则将会出现该目录下所有文件名,而如何能将“*”本身赋值
: 给变量a,使echo $a显示的只是“*”,HOW TO DO THAT ?

avatar
u*n
3

spitfire 116: set a="'*'"
spitfire 117: echo $a
echo: No match

【在 m*****e 的大作中提到】
: set a="'*'"
avatar
d*g
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

avatar
u*n
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:
: *

avatar
c*t
6
Your question is unclear.

【在 u*******n 的大作中提到】
: hehe....
: I want "echo $a" ----> *
: Not just echo "*"----> *
: 如何能将“*”本身赋值给变量a,使echo $a显示的只是“*” ?

avatar
d*g
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显示的只是“*” ?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。