一、语法for var in con1 con2 con3 ...do # 执行内容donefor var in {min..max}do # 执行内容donefor (( 初始值; 限制值; 步阶 ))do # 执行内容done二、练习输出 Shell 的运行时的输入参数echo...
分类:
系统相关 时间:
2014-10-28 17:08:12
阅读次数:
254
命令行demo如下:adb shell am instrument -e class com.autonavi.MinimapAutomationTool#testLayerCancelButton -w com.autonavi/android.test.InstrumentationTestRu...
分类:
移动开发 时间:
2014-10-28 17:08:04
阅读次数:
159
一、语法until [ condition ] # 和while相反,当 condition 条件成立时,就终止回圈, 否则就持续进行回圈的程序段do #执行内容done二、练习输入用户输入的参数,直到用户输入 "end" 结束循环untilread -p "Plz input a para...
分类:
系统相关 时间:
2014-10-28 16:58:05
阅读次数:
237
符合
含义
&&
command1 && command2:命令1返回真(命令返回值 $? == 0)后,命令2才能被执行。可以用于if判断。
cp 1.txt ../ && echo "succes" #-->success
cp 1.txt ../ && rm -f ../1.txt && echo "success" -->success...
分类:
系统相关 时间:
2014-10-28 15:33:08
阅读次数:
263
Bash是linux默认的shell,bash的东西非常的多,包括变数的设定与使用、 bash 操作环境的建置、资料流重导向的功能,掌握一些shell操作技巧,在以后的工作中可事半功倍,需要的朋友可以参考下,还可学习Linux视频教程。tab键补全用法当我们敲击一下tab补全命令或文件名当我们敲击两...
分类:
其他好文 时间:
2014-10-28 15:26:32
阅读次数:
297
shell中可能经常能看到:>/dev/null 2>&1命令的结果可以通过%>的形式来定义输出/dev/null 代表空设备文件> 代表重定向到哪里,例如:echo "123" > /home/123.txt1 表示stdout标准输出,系统默认值是1,所以">/dev/null"等同于"1>/d...
分类:
其他好文 时间:
2014-10-28 15:13:17
阅读次数:
174
#!/usr/bin/env python#-*-encoding:utf-8 -*-import subprocessdef gen_vmlog(cmd): result = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE) ...
分类:
数据库 时间:
2014-10-28 15:11:32
阅读次数:
281
Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\cmd]@="DOS 到这里"[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\c...
分类:
其他好文 时间:
2014-10-28 13:50:57
阅读次数:
191
cpu信息采集cpu使用率采集算法通过/proc/stat文件采集并计算CPU总使用率或者单个核使用率。以cpu0为例,算法如下:1. cat /proc/stat | grep ‘cpu0’得到cpu0的信息2. cpuTotal1=user+nice+system+idle+iowait+irq...
分类:
系统相关 时间:
2014-10-28 13:48:11
阅读次数:
253
gedit hello.sh
,然后输入
#!/bin/bash
echo "Hello world!"
chmod +x hello.sh
./hello.sh...
分类:
系统相关 时间:
2014-10-28 12:16:17
阅读次数:
208