# who jane pts/4 Sep 2 2:30 (oweoiutoiuywroitu) I want it echo the user name "jane", so I use the following : # echo $argv[1] error # echo $argv[0] # nothing returned.
r*a
6 楼
对您的佩服如滔滔江水。。。。。。。
【在 t*******l 的大作中提到】 : # who : jane pts/4 Sep 2 2:30 (oweoiutoiuywroitu) : I want it echo the user name "jane", so I use the following : : # echo $argv[1] : error : # echo $argv[0] : # : nothing returned.
o*z
7 楼
or try who -q | grep -v "^#"
【在 t*******l 的大作中提到】 : # who : jane pts/4 Sep 2 2:30 (oweoiutoiuywroitu) : I want it echo the user name "jane", so I use the following : : # echo $argv[1] : error : # echo $argv[0] : # : nothing returned.
t*l
8 楼
don't say so... I am a beginner of unix.
【在 r**a 的大作中提到】 : 对您的佩服如滔滔江水。。。。。。。
t*l
9 楼
perfect! thanks for teaching !
【在 o***z 的大作中提到】 : or try : who -q | grep -v "^#"
r*a
10 楼
不如用whoami算了 那个grep -v "^#" 屁用没有,hoho!
【在 o***z 的大作中提到】 : or try : who -q | grep -v "^#"
t*l
11 楼
but I learn about grep -v "^#" at the same time! :)))) it is useful to me. also , I learn "whoami" this time too! also great!
r*a
12 楼
hoho! Good luck lah!
【在 t*******l 的大作中提到】 : but I learn about grep -v "^#" at the same time! :)))) : it is useful to me. : also , I learn "whoami" this time too! : also great!
r*a
13 楼
if u insist to use echo, then: echo `whoami`
【在 t*******l 的大作中提到】 : but I learn about grep -v "^#" at the same time! :)))) : it is useful to me. : also , I learn "whoami" this time too! : also great!
t*l
14 楼
great. see, unix is so versatile, so flexible. that is why I LOVE IT! I have to learn it, try to be perfect!
t*l
15 楼
but I still want to know why echo $argv[1] and echo $argv[0] doesn't work.
【在 r**a 的大作中提到】 : if u insist to use echo, then: : echo `whoami`
【在 t*******l 的大作中提到】 : but I still want to know why echo $argv[1] and echo $argv[0] doesn't work.
d*i
17 楼
try who | awk '{print $1}'
【在 t*******l 的大作中提到】 : # who : jane pts/4 Sep 2 2:30 (oweoiutoiuywroitu) : I want it echo the user name "jane", so I use the following : : # echo $argv[1] : error : # echo $argv[0] : # : nothing returned.