随笔分类 -  Linux/Shell

[转] Bash中的if
摘要:if语法[Linux(bash_shell)] BASH IF我使用过的Linux命令之if - Bash中的条件判断语句关于bash中if语法结构的广泛误解Linux 技巧:Bash的测试和比较函数(探密test,[,[[,((和if-then-else)if语法[Linux(bash_shell)] http://blog.csdn.net/ycl810921/article/details/49887781:定义变量时, =号的两边不可以留空格.eg:gender=femal------------rightgender =femal-----------wronggender= fem 阅读全文

posted @ 2012-09-04 08:47 haivey 阅读(11641) 评论(0) 推荐(2)

[转] shell脚本中一些特殊符号
摘要:转:http://blog.chinaunix.net/u1/49742/showart_2001591.html 1、{}大括号: 用法一:通配符扩展 eg: ls my_{finger,toe}s 这条命令相当于如下命令的组合: ls my_fingers my_toes eg: mkdir {userA,userB,userC}-{home,bin,data}我们将得到 userA-home, userA-bin, userA-data, userB-home, userB-bin,userB-data,userC-home, userC-bin, userC-data,这几个目录用法. 阅读全文

posted @ 2012-08-06 18:04 haivey 阅读(213) 评论(0) 推荐(0)

[转] bash脚本
摘要:http://blog.sina.com.cn/s/blog_6419abc70100wlhl.html写的太好,我实在忍不住收在自己的博客下:一个最简单的脚本这篇指南将通过一些例子来帮助大家学习功能强大的shell脚本编程.在这一节中我将学习一些简单的脚本,它将有利于你深入学习一些知识。一个最经典的Hello World程序#!/bin/bashecho Hello World这个脚本只有二行,它的第一行这个脚本程序由那个程序来解释.第二行只有一个简单的动作,它的功能是在终端上打印出一行”Hello World” 。如果你测试着执行这个命令时(./hello.sh),你将会得到一个comma 阅读全文

posted @ 2012-08-06 18:01 haivey 阅读(201) 评论(0) 推荐(0)

导航