一、基本的语法1.1、shell文件开头shell文件必须以以下的行開始(必须方在文件的第一行):#!/bin/sh符号#!用来告诉系统它后面的參数是用来运行该文件的程序。在这个样例中我们使用/bin/sh来运行程序。当编辑好脚本时,假设要运行该脚本,还必须使其可运行。要使脚本可运行:执行chmod...
分类:
其他好文 时间:
2014-09-20 19:15:59
阅读次数:
259
while do done, until do done (不定循环)while [ condition ] $s"for...do...done (固定回圈)for 这种语法,则是『 已经知道要进行几次回圈』的状态!他的语法是:for var in con1 con2 con3 ...do...
分类:
其他好文 时间:
2014-09-20 18:44:59
阅读次数:
271
利用 if .... then单层、简单条件判断式if [ 条件判断式 ]; then 当条件判断式成立时,可以进行的命令工作内容;fi {$0 someword}"else echo "The only parameter is 'hello', ex> {$0 hello}"finetst...
分类:
其他好文 时间:
2014-09-20 18:00:29
阅读次数:
262
AWKawk是一种编程语言,用于在linux/unix下对文本和数据进行处理。sedsed是一种流编辑器,它是文本处理中非常中的工具grepgrep是一种强大的文本搜索工具,常常跟管道结合使用WC使用wc命令统计文本信息,利用wc指令我们可以计算文件的Byte数、字数或是列数 wc参数 -c ...
分类:
其他好文 时间:
2014-09-20 15:22:47
阅读次数:
203
Linux文件查找命令find,xargs详述...
分类:
系统相关 时间:
2014-09-20 14:05:27
阅读次数:
361
Shell分类表 Shell名称 程序名 普通用户提示符 超级用户提示符 Bourne Shell/usr/bin/sh$# Bourne Again SHell/usr/bin/bash$# C Shell/usr/bin/csh%# K Shell/usr/bin/...
分类:
其他好文 时间:
2014-09-20 09:55:27
阅读次数:
209
简单的 shell script 练习简单范例 对谈式脚本:变量内容由使用者决定[root@www scripts]# vi sh02.sh#!/bin/bash# Program:# User inputs his first name and last name. Program shows.....
分类:
其他好文 时间:
2014-09-20 08:49:06
阅读次数:
239
什么是 Shell scriptsshell script (程序化脚本) :shell script 是针对 shell 所写的『脚本!』shell script 是利用 shell 的功能所写的一个『程序 (program)』,这个程序是使用纯文字档,将一些 shell 的语法与命令(含外部命....
分类:
其他好文 时间:
2014-09-20 08:48:36
阅读次数:
239
1. 在 用户目录下 ~/.bash_profile vim ~/.bash_profile 2.加入我们需要添加的环境变量,这里是 添加 android platform-tools 和 toolsexport PATH=${PATH}:/Users/user/android-sdks/pl...
分类:
移动开发 时间:
2014-09-20 03:32:16
阅读次数:
197