Shell Script Practice 2 Summary】的更多相关文章

[这篇博客主要是我个人对这个任务的总结, 主要目的不是拿来和分享的, 所以难免让人感觉不知所云, 请直接忽视这篇即可.] 处理任务为两个输入文件comfe(1,000,000行,文件结构"域名 NS 该域名的权威服务器")和iplab.txt(64万行, 文件结构 "IP起始地址 CN 中国 地区编号 地区名称 省编号 省名称 市编号 市名称"), 要求将"权威服务器位于中国"的域名及其所在的 省市输出. 整个程序主要包括5个部分: 1.得到无重…
How to Create a First Shell Script   Shell scripts are short programs that are written in a shell programming language and interpreted by a shell process. They are extremely useful for automating tasks on Linux and other Unix-like operating systems.…
摘要:概述.script的编写.test命令.[]判断符号.默认变量($1...).if...then条件判断式. 一.概述 [什么是shell script] 针对shell所写的脚本,将多个命令汇整起来一起执行 可以进行类似程序的编写,并且不需要经过编译就能够执行 利用shell的功能所写的一个“程序”,这个程序是使用纯文本文件,将一些shell的语法与命令写在里面,搭配正则表达式.管道命令与数据流重定向等功能,以达到我们所想要的处理目的. [用途] 简化我们日常的工作管理 一些服务的启动都…
Write shell script: 1) Editor like vi or mcedi 2) Set execute permission for your script chmod  permission  your-script-name $ chmod +x your-script-name $ chmod 755 your-script-name This will set read write execute(7) permission for owner, for group…
一.格式 1.1 开头 必须以 "# !/bin/bash"  开头,告诉系统这是一个bash shell脚本.注意#与!中间有空格. 二.语法 2.1 数值运算 可以用declare -i声明为数值类型,也可以用 var = $((数值运算)),注意是两个括号 2.3 善用判断式 2.3.1 test命令 test命令可以测试,可以利用测试的结果走后续流程.测试文件和文件属性还是比较方便的. :~/test$ test -e nofile && echo "…
一.shell script的编写与执行 1.shell script 的编写中还需要用到下面的注意事项: a.命令的执行是从上到下,从左到右地分析与执行 b.命令.参数间的多个空白都会被忽略掉 c.空白行也将被忽略掉, 并且[tab]按键所得的空白同样视为空格键  d.如果读取到一个Enter符号(CR),就尝试开始执行该行(或该串)命令 e.至于如果一行的内容太多,则可以使用"\[Enter]"来扩展至下一行  f."#"可作为批注. 2.执行文件(/home/…
source: http://linoxide.com/linux-shell-script/shell-script-check-linux-system-health/ This article introduces a shell script to perform linux system health check.This script collects system information and status like hostname, kernel version, uptim…
执行脚本的几种方式: 1. sh a.sh 或者  bash a.sh  调用的是 /bin/bash 进程执行的,所以脚本不需要执行权限. 2. 直接使用绝对路径执行, /home/script/a.sh  ,脚本需要有执行权限,如果没有权限可执行 chmod a+x a.sh 加入执行权限. (lampp启动数据库用的就是: /opt/lampp/lampp startmysql ) sh03.sh 根据时间创建目录 #!/bin/bash echo -e "I will use 'touc…
这些年我们一起搞过的持续集成~Jenkins+Perl and Shell script ##转载注明出处:http://www.cnblogs.com/wade-xu/p/4378224.html 部门用持续集成已经很久了,但其实使用起来还是很麻烦的,每当要给一个新项目set up持续集成的环境,虽然是Copy一些现有的jobs, 但是许多参数,变量需要去改,然后还有调试,少说3,4天搞一下,非常不方便. 最近比较空,就把现有的持续集成系统升级改造下,job用一套模板,全部参数化,只要修改配置…
CentOS 的tomcat安装目录:/usr/local/tomcat vi MyTomcatUitl.sh          创建文件chmod u+x MyTomcatUtil.sh   赋执行权限 shell script : #!/bin/bash # tomcat启动,停止,日志显示脚本 == ''];then echo "请带一个参数执行命令:start 启动tomcat,stop 停止tomcat , logs 查看tomcat动态日志" exit fi == 'sta…