SHELL脚本基础

if [-f filename] 判断文件   ; if [-d dir] 判断目录 f [-r file] 判断文件是否可读 w 可写 x 可执行  z 是否为空

case 变量 in

for循环 do

echo -n 一行输出  -e 对\ 命令进行解释   t 使用tab空格

给某个变量设置多个值可以把值放在括号内,值与值之间用空格分隔。输出时默认是输出第一个值,如果要引用其中一个单独的数组元素,需要用代表它在数组中的位置的数值索引值。索引值要用方括号扩起来。0代表第一个数值,变量需要用{[]}的格式。

如果要全部输出,可以用通配符* 来实现。  如果想要改变其中某个值可以使用 变量[位置]=新值

使用unset可以删除其中某一个数值或者删除整个数组。

分享到:

6 条评论

昵称
  1. Hi it’s me, I am also visiting this web page on a regular basis, this site is in fact nice and the
    users are actually sharing pleasant thoughts.

  2. I’m impressed, I have to admit. Seldom do I encounter a blog
    that’s both equally educative and amusing, and let me tell you,
    you have hit the nail on the head. The problem is an issue that not enough men and women are speaking intelligently
    about. Now i’m very happy I found this in my
    hunt for something relating to this.

  3. Great blog here! Also your website loads up very fast!

    What host are you using? Can I get your affiliate link
    to your host? I wish my site loaded up as quickly as yours lol

  4. milfs

    Right away I am going away to do my breakfast, later than having my
    breakfast coming over again to read additional news.

  5. sms marketing

    Sweet blog! I found it while surfing around on Yahoo
    News. Do you have any tips on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Many thanks

  6. ETIAS Visa

    It’s going to be ending of mine day, except before ending
    I am reading this impressive article to increase my knowledge.