随笔分类 -  Shell Commands

shell scripts commands
摘要:#********************************************#Source File Name = #Copy Right Information# Function = # Operation System =#********************************************## File Name: path/name# Called By: other file name# # Description:# Authors:# History:##********************************************. 阅读全文

posted @ 2012-02-07 13:59 bannyle 阅读(183) 评论(0) 推荐(0)

摘要:1. Log tool# note that the symbol around date is not single quotes# also that's a tool to invoke shell command, such as 'date', 'pwd', 'hostname' or something elseechoThis(){ timestamp=`date` #echo "[$timestamp] $@" echo "[$timestamp] $@" > /dev/std 阅读全文

posted @ 2012-02-06 10:44 bannyle 阅读(434) 评论(0) 推荐(0)

摘要:1. 字符串相关操作1.1 获取字符串长度str="9.125.70.107 localhost domain"# length${#str}1.2 字符串截取 1.2.1 索引截取str="9.125.70.107 localhost domain"substr=${str:0:${#str}-3}echo $subStroutput:9.125.70.107 localhost dom 1.2.2 索引某个子字符串之后的字符串str="9.125.70.107_ localhost domain"sub="9.125.7 阅读全文

posted @ 2011-12-30 21:09 bannyle 阅读(296) 评论(0) 推荐(0)

导航