摘要:
Linux shell脚本基础学习,虽然不涉及具体东西,但是打好基础是以后学习轻松地前提。1. Linux 脚本编写基础◆1.1 语法基本介绍1.1.1 开头程序必须以下面的行开始(必须方在文件的第一行):#!/bin/sh符号#!用来告诉系统它后面的参数是用来执行该文件的程序。在这个例子中我们使用/bin/sh来执行程序。当编辑好脚本时,如果要执行该脚本,还必须使其可执行。要使脚本可执行:编译 chmod +x filename 这样才能用./filename 来运行1.1.2 注释在进行shell编程时,以#开头的句子表示注释,直到这一行的结束。我们真诚地建议您在程序中使用注释。如果您使用 阅读全文
摘要:
grep的用法首先创建我们练习grep命令时需要用到的demo文件demo_file。$ cat demo_fileTHIS LINE IS THE 1ST UPPER CASE LINE IN THIS FILE.this line is the 1st lower case line in this file.This Line Has All Its First Character Of The Word With Upper Case.Two lines above this line is empty.And this is the last line.1.从单个文件中搜索指定的字串 阅读全文