SHELL脚本基础

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

case 变量 in

for循环 do

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

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

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

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

分享到:

75 条评论

昵称
  1. Very interesting info!Perfect just what I was searching for!

  2. P'tits Tutos

    I?¦ve learn several just right stuff here. Definitely worth bookmarking for revisiting. I surprise how a lot attempt you put to create such a wonderful informative web site.

  3. view website

    Awsome blog! I am loving it!! Will come back again. I am taking your feeds also.

  4. more hints

    F*ckin’ tremendous things here. I am very glad to see your post. Thanks a lot and i am looking forward to contact you. Will you please drop me a e-mail?

  5. Anabolika kaufen

    I have to express some appreciation to this writer just for bailing me out of this type of incident. Right after browsing through the world-wide-web and meeting advice that were not helpful, I assumed my entire life was over. Living without the answers to the issues you’ve fixed through your entire site is a critical case, and ones which may have badly affected my career if I hadn’t discovered your web blog. Your own know-how and kindness in dealing with a lot of stuff was excellent. I am not sure what I would have done if I had not come across such a subject like this. I am able to at this moment look forward to my future. Thanks very much for the impressive and sensible guide. I will not hesitate to propose the blog to anybody who wants and needs direction on this problem.

  6. Thanks a bunch for sharing this with all of us you really know what you’re talking about! Bookmarked. Kindly also visit my site =). We could have a link exchange agreement between us!

  7. The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.

  8. Buy Adipex Retard Online

    Enjoyed studying this, very good stuff, regards.

  9. steroide online bestellen

    Great site. Plenty of useful information here. I’m sending it to some pals ans additionally sharing in delicious. And of course, thank you in your sweat!

  10. anabole steroide kaufen

    Great ?V I should certainly pronounce, impressed with your site. I had no trouble navigating through all the tabs and related info ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Reasonably unusual. Is likely to appreciate it for those who add forums or something, site theme . a tones way for your customer to communicate. Excellent task..

  11. Acheter Melanotan 2

    When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get three emails with the same comment. Is there any way you can remove people from that service? Many thanks!

  12. steroide kaufen

    I have been absent for some time, but now I remember why I used to love this website. Thank you, I’ll try and check back more often. How frequently you update your website?

  13. you might have an important blog right here! would you wish to make some invite posts on my weblog?

  14. website here

    You made some good points there. I did a search on the topic and found most individuals will consent with your website.

  15. try this out

    you’ve an incredible weblog right here! would you like to make some invite posts on my blog?