linux学习之shell脚本 ------- 文本过滤

[本文是自己学习所做笔记,欢迎转载,但请注明出处:http://blog.csdn.net/jesson20121020]

今天来看一下shell关于文字过滤的知识,其实最主要的就是正则表达式以及关于文本的一常见的命令。

正则表达式:

一种用来描述文本模式的特殊语法。

由普通字符(例如字符a到z)以及特殊字符(称为元字符,如/、*、?等)组成。

基本元字符集及其含义:

字符

含义

^

只匹配行首

$

只匹配行尾

*

匹配0个或多个单字符

[ ]

只匹配[]内字符,可以是一个单字符,也可以是字符序列,可以使用-表示[]内字符序列范围,如[1-5]代表[12345]

\

只用来屏蔽一个元字符的特殊含义

.

只匹配任意单个字符

pattern\{n\}

只用来匹配前面pattern出现次数,n为次数

pattern\{n,\}

含义同上,但次数最少为n

Pattern\{n,m\}

含义同上,但pattern出现次数在n与m之间

部分元字符具体用法:

用\屏蔽一个特殊字符

这里的特殊字符有’’,‘,||,*,+等

\*\.pas

- 正则表达式中匹配以*.pas结尾的所有字符或文件

用[]匹配一个范围或集合

- 逗号将括弧内要匹配的不同字符串分开

- 用 -表示一个字符串范围,表明字符串范围从-左边字符开始,到-右边字符结束。

例子:

[0123456789]或[0-9]:假定要匹配任意一个数字。

[a-z]:匹配任意小写字母

[A-Z a-z]:匹配任意大小写字母

[A-Z a-z0-9]:匹配任意字母或数字

[S,s]:匹配大小写s

用\{\}匹配模式结果出现的次数

例子:

A\{2\}B:A出现2次,即AAB

A\{4,\}B:A最少出现4次,AAAAB,AAAAAB,....

A\{\2,4}B:A出现次数2-4次,即AAB,AAAB,AAAAB

一些关于文本处理的命令:

find命令

-命令形式:

Find pathname -option [-print -exec -ok]

- pathname: find命令所查找的目录

- -print: find命令将匹配的文件输出到标准输出

- -exec: find命令对匹配的文件执行该参数所给出的shell命令,相应命令的形式为 ‘command’ {} \; ,注意{}和\;之间的空格

- -ok 和 -exec的作用相同,只不过以一种更为安全的模式来执行该参数所给出的shell命令,在执行每一个命令之前,都会给出提示,让用户来确定是否执行。

- -name: 按照文件名来查找

- -perm: 按照文件权限来查找

- -user: 按照文件所有者来查找文件

- -group: 按照文件所属组来查找文件

- -mtime -n +n: 按照文件的更改时间来查找文件, -n 表示文件更改时间距现在n天以内,+n表示文件更改时间距现在n天以前。

- -size n[c]: 查找文件长度为n块的文件,带有c时表示文件长度以字节计

- -nogroup: 查找无有效所属组的文件,即该文件所属的组在/etc/groups中不存在

- -nouser: 查找无有效所有者的文件

- -newer file1 !file2:查找更改时间比文件file1新,但是比文件file2旧的文件

- -type:查找某一类型的文件,如:

b: 块设备文件

d: 目录

c: 字符设备文件

p: 管道文件

l: 符号链接文件

f: 普通文件

- -xargs

在使用find命令时的-exec选项处理匹配到的文件时,find命令将所有匹配到文件一起传递给exec。不幸的是,有些系统对能够传递给exec的命令的长度有限制,这样在find命令运行几分钟后,就会出现溢出的错误。错误信息通常是”参数列太长”或”参数列溢出” 。这就是xargs命令的用处所在,特别是与find命令一起使用。-exec会发起多个进程,但-xargs不会发起多个进程,只有一个。

- -depth选项

使用find命令时,可以希望先匹配所有文件,再在子目录中查找关于find命令的选项有很多,这里只列出了常用的选项,更多的参数,可以通过man find来查看。

部分选项例子:

-newer选项

jesson@jesson-HP:~/develop/workspace/shell_workspace$ find -newer "who.out" ! -newer "term.txt"

./ls.out

./term.txt

./path.out

./nullfile.txt

./ls_sort.out-size 选项jesson@jesson-HP:~/develop/workspace/shell_workspace$ find -size +300c

./parm.sh

jesson@jesson-HP:~/develop/workspace/shell_workspace$ ls -al parm.sh

-rwxrw-r-- 1 jesson jesson 637 1月 17 17:07 parm.sh-depth选项

使用find命令时,可以希望先匹配所有文件,再在子目录中查找

find / -name “CON.FILE” -depth -print- 用exec或ok来执行shell命令find . -type f -exec ls -l {} \;

find. -name “*.log” -mtime +5 -ok rm {} \;-xargsfind -type f -print | xargs file

Find ./ -perm -7 -print | xargs chmod o-w

grep命令

对文本文件进行模式查找

有三种变形:

- grep:标准grep命令

- egrep:扩展的grep命令,支持基本及扩展的正则表达式

- fgrep:快速grep命令

一般格式:

- grep [option]基本正则表达式[文件]

- 字符串参数最好采用双引号括,一是以防被误解为shell命令,二是可以用来查找多个单词组成的字符串

命令选项:

- -c:只输出匹配行的计数

- -i:不区分大小写(只适用于单字符)

- -h:查询多文件时不显示文件名

- -H:显示文件名

- -l:查询多文件时只输出包含匹配字符的文件

- -n:显示匹配行及行号

- -s:不显示不存在无匹配文本的错误信息

- -v:显示不包含匹配文本的所有行

例子:

grep “jesson” *.txt

- 在所有.txt文件中查找jesson

grep “^[^201]” myfile

- 在myfile中查找不是以2,0,1开头的行

grep “^$” myfile

- 在myfile中查找空行

grep “^[^dlp]” myfile

- 在myfile中查找不是以d l p开头的行

grep命令类名

等价的正则表达式

[[:upper:]]

[A-Z]

[[:alnum:]]

[0-9a-zA-Z]

[[:lower:]]

[a-z]

[[:space:]]

空格或tab

[[:digit:]]

[0-9]

[[:alpha::]]

[a-zA-Z]

awk介绍

awk可以从文件字符串中基于指定规则浏览和抽取信息,是一种自解释的编程语言。

调用awk三种方式:

- 命令行方式:

awk [-F field-spearator] ‘command’ input-files

- awk脚本

所有awk命令插入一个文件,并使awk程序可执行,然后用awk命令解释器作为脚本的首行,以便通过键入脚本名称来调用它。

- awk命令插入一个单独的文件

awk -f awk-scipt-file input-files

awk脚本是由各种模式和动作组成。

模式和动作:

-模式部分决定动作语句何时触发及触发事件(BEGIN,END)

-动作对数据进行处理,放在大括号{}内指明。如print

分隔符、域和记录

-awk执行时,其浏览域标记为$1,$2,....,$n.。这种方法称为域标识,$0为所有域。

-注意执行时不要混淆符号$和shell提示符$。

awk 中特殊元字符:+,?

匹配操作符:~,!~

cat myfile | awk '$0 ~/218.79.131.96/'

-打印出myfile中以匹配218.79.131.96的行

awk '$0 !~ /218.79.131.96/' myfile

-打印出myfile中不匹配218.79.131.96的行

awk '{if($1 == "218.79.131.96") print $0}' myfile

-打印出myfile中第一列等于218.79.131.96的行。

例子:

awk '{print $0}' myfile

-打印出myfile中所有域,即打印出文件中的所有文件。

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ awk '{print $0}' lsout.txt

总用量 60

-rw-rw-r-- 1 jesson jesson 0 1月 22 23:43 2

-rwxrwxr-x 1 jesson jesson 263 1月 24 00:05 break_test.sh

-rwxrwxr-x 1 jesson jesson 218 1月 23 00:07 case_test.sh

-rwxrwxr-x 1 jesson jesson 459 1月 24 00:07 continue_test.sh

-rwxrwxr-x 1 jesson jesson 104 1月 22 23:07 file_desc.sh

-rwxrwxr-x 1 jesson jesson 67 1月 23 23:04 for_test1.sh

-rwxrwxr-x 1 jesson jesson 78 1月 23 23:05 for_test2.sh

-rwxrwxr-x 1 jesson jesson 73 1月 23 23:06 for_test3.sh

-rwxrwxr-x 1 jesson jesson 46 1月 22 23:03 helloworld.sh

-rw-rw-r-- 1 jesson jesson 573 1月 16 00:30 homefile.txt

-rw-rw-r-- 1 jesson jesson 573 1月 16 00:31 homefile.txt.sort

-rwxrwxr-x 1 jesson jesson 217 1月 22 23:42 if_test.sh

-rw-rw-r-- 1 jesson jesson 0 1月 31 10:08 lsout.txt

-rw-rw-r-- 1 jesson jesson 14 1月 22 23:07 name.txt

-rwxrwxr-x 1 jesson jesson 112 1月 23 23:32 until_test.sh

-rwxrwxr-x 1 jesson jesson 132 1月 23 23:47 while_test1.sh

-rwxrwxr-x 1 jesson jesson 72 1月 23 23:49 while_test2.shawk '{print $9 "\t" $3}' myfile

-打印出myfile中第9列和第三列,并以tab分隔.

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ awk '{print $9 "\t" $3}' lsout.txt

break_test.shjesson

case_test.shjesson

continue_test.shjesson

file_desc.shjesson

for_test1.shjesson

for_test2.shjesson

for_test3.shjesson

helloworld.shjesson

homefile.txtjesson

homefile.txt.sortjesson

if_test.shjesson

lsout.txtjesson

name.txtjesson

until_test.shjesson

while_test1.shjesson

while_test2.shjesson   另外,可以通过"-F 分隔符"来指定分隔。

awk BEGIN END用法:

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ awk 'BEGIN {print "Current directory file and its owner"} {print $3 ": " $9} END {print "end-of-report"}' lsout.txt

Current directory file and its owner

jesson: break_test.sh

jesson: case_test.sh

jesson: continue_test.sh

jesson: file_desc.sh

jesson: for_test1.sh

jesson: for_test2.sh

jesson: for_test3.sh

jesson: helloworld.sh

jesson: homefile.txt

jesson: homefile.txt.sort

jesson: if_test.sh

jesson: lsout.txt

jesson: name.txt

jesson: until_test.sh

jesson: while_test1.sh

jesson: while_test2.sh

end-of-report

sed介绍

sed不与初始化文件打交道,它操作的只是一个拷贝,然后所有的改变如果没有重定向到一个文件,就将输出到屏幕。sed是一种重要的文本过滤工具,使用一行命令或者使用管道与grep或awk相结合使用。另外,它也是非交互性文本流编辑。

调用sed方式:

-使用sed命令行格式:

sed [选项] sed命令 输入文件

-使用sed脚本文件

sed [选项] -f sed脚本文件 输入文件

-sed 脚本文件 [选项] 输入文件

不管是使用shell命令行方式还是脚本文件方式,如果没有指定输入文件,则sed从标准输入中接受输入,一般是键盘。

sed命令选项:

-n 不打印没有匹配到的

-c 下一命令是编辑命令

-f 正在调用sed脚本文件

sed在文件中查询文体的方式

-使用行号,可以是一个简单的数字,也可以是一个行号范围。

-使用正则表达式

x

x为一行号

x,y

表示行号范围从x到y

/pattern/

查询包含模式的行

/pattern/pattern/

查询包含两个模式的行

pattern/,x

查询在给定行号上查询包含模式的行

x,/pattern/

通过行号和模式查询匹配和行

x,y!

查询不包含指定行号x 和y的行

基本sed编辑命令:

p

打印匹配行

=

显示文件行号

a\

在定位行号附加新文本信息

i\

在定位行号后插入新文本信息

d

删除定们行

c\

用新文本替换定位文本

s

使用替换模式替换相应模式

r

从另一文件中读文本

w

写文本到一个文件

q

第一个模式匹配完成后退出或立即退出

l

显示与八进制ASCII代码等价的控制字符

{}

在定位行执行的命令组

n

从另一个文件中读文本下一行,并附加在下一行

g

将模式2粘贴到/pattern n/

y

传送字符

部分用法例子:

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed '2p' lsout.txt

总用量 60

-rwxrwxr-x 1 jesson jesson 263 1月 24 00:05 break_test.sh

-rwxrwxr-x 1 jesson jesson 263 1月 24 00:05 break_test.sh

-rwxrwxr-x 1 jesson jesson 218 1月 23 00:07 case_test.sh

-rwxrwxr-x 1 jesson jesson 459 1月 24 00:07 continue_test.sh

-rwxrwxr-x 1 jesson jesson 104 1月 22 23:07 file_desc.sh

-rwxrwxr-x 1 jesson jesson 67 1月 23 23:04 for_test1.sh

-rwxrwxr-x 1 jesson jesson 78 1月 23 23:05 for_test2.sh

-rwxrwxr-x 1 jesson jesson 73 1月 23 23:06 for_test3.sh

-rwxrwxr-x 1 jesson jesson 46 1月 22 23:03 helloworld.sh

-rw-rw-r-- 1 jesson jesson 573 1月 16 00:30 homefile.txt

-rw-rw-r-- 1 jesson jesson 573 1月 16 00:31 homefile.txt.sort

-rwxrwxr-x 1 jesson jesson 217 1月 22 23:42 if_test.sh

-rw-rw-r-- 1 jesson jesson 0 1月 31 10:35 lsout.txt

-rw-rw-r-- 1 jesson jesson 14 1月 22 23:07 name.txt

-rwxrwxr-x 1 jesson jesson 112 1月 23 23:32 until_test.sh

-rwxrwxr-x 1 jesson jesson 132 1月 23 23:47 while_test1.sh

-rwxrwxr-x 1 jesson jesson 72 1月 23 23:49 while_test2.sh

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '2p' lsout.txt

-rwxrwxr-x 1 jesson jesson 263 1月 24 00:05 break_test.sh

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '1,4p' lsout.txt

总用量 60

-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh

-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh

-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '/while/p' lsout.txt

-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh

-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '2,/for/p' lsout.txt

-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh

-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh

-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh

-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh

-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '/name/a \hello sed!' lsout.txt

hello sed!

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ cat name.txt

jesson

cherry

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed '/jesson/c\jesson20121020' name.txt

jesson20121020

cherry

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed '/jesson/i\jesson20121020' name.txt

jesson20121020

jesson

cherry

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed '1d' name.txt

cherryjesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ cat name.txt

jesson

jesson

merry

cherry

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed 's/jesson/jesson20121020/g' name.txt

jesson20121020

jesson20121020

merry

cherry

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n 's/jesson/& hello/p' name.txt

jesson hello

jesson hello

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n 's/jesson/hello &/p' name.txt

hello jesson

hello jesson

有关sed的更多用法,可以查看帮助文档,man sed 或 info sed

合并与分隔

sort命令

用法:

sort [options] files

-许多不同的域按不同的列顺序分类。

--c测试文件是否已经分类

--m合并两个分类文件

--u删除所有重复行

--o存储sort结果的输出文件名

--t 域分隔符;用非空格或tab键分隔域

-+n n为域号,使用此域号开始分类

-n指定分类是域上的数字分类项

--r 比较求决逆。

例子:

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sort -c name.txt

sort:name.txt:4:无序: cherry

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ cat lsout.txt

总用量 60

-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh

-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh

-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh

-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh

-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh

-rwxrwxr-x 1 jesson jesson  78  1月 23 23:05 for_test2.sh

-rwxrwxr-x 1 jesson jesson  73  1月 23 23:06 for_test3.sh

-rwxrwxr-x 1 jesson jesson  46  1月 22 23:03 helloworld.sh

-rw-rw-r-- 1 jesson jesson 573  1月 16 00:30 homefile.txt

-rw-rw-r-- 1 jesson jesson 573  1月 16 00:31 homefile.txt.sort

-rwxrwxr-x 1 jesson jesson 217  1月 22 23:42 if_test.sh

-rw-rw-r-- 1 jesson jesson   0  2月  1 18:03 lsout.txt

-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt

-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt

-rwxrwxr-x 1 jesson jesson 112  1月 23 23:32 until_test.sh

-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh

-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sort -u lsout.txt

-rw-rw-r-- 1 jesson jesson   0  2月  1 18:03 lsout.txt

-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt

-rw-rw-r-- 1 jesson jesson 573  1月 16 00:30 homefile.txt

-rw-rw-r-- 1 jesson jesson 573  1月 16 00:31 homefile.txt.sort

-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh

-rwxrwxr-x 1 jesson jesson 112  1月 23 23:32 until_test.sh

-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh

-rwxrwxr-x 1 jesson jesson 217  1月 22 23:42 if_test.sh

-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh

-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh

-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh

-rwxrwxr-x 1 jesson jesson  46  1月 22 23:03 helloworld.sh

-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh

-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh

-rwxrwxr-x 1 jesson jesson  73  1月 23 23:06 for_test3.sh

-rwxrwxr-x 1 jesson jesson  78  1月 23 23:05 for_test2.sh

总用量 60

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sort -r lsout.txt

总用量 60

-rwxrwxr-x 1 jesson jesson  78  1月 23 23:05 for_test2.sh

-rwxrwxr-x 1 jesson jesson  73  1月 23 23:06 for_test3.sh

-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh

-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh

-rwxrwxr-x 1 jesson jesson  46  1月 22 23:03 helloworld.sh

-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh

-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh

-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh

-rwxrwxr-x 1 jesson jesson 217  1月 22 23:42 if_test.sh

-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh

-rwxrwxr-x 1 jesson jesson 112  1月 23 23:32 until_test.sh

-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh

-rw-rw-r-- 1 jesson jesson 573  1月 16 00:31 homefile.txt.sort

-rw-rw-r-- 1 jesson jesson 573  1月 16 00:30 homefile.txt

-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt

-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt

-rw-rw-r-- 1 jesson jesson   0  2月  1 18:03 lsout.txt

uniq命令

格式:

uniq [option] files

-从一个文本文件中去除或禁止重复行

--u只显示不重复行

--d只显示有重复的行,每种重复行只显示其中一行

--c打印每一重复行出现次数

--f n n为数字,前n个域被忽略。

例子:

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ uniq -c name.txt

2 jesson

1 merry

1 cherry

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ uniq -d name.txt

jesson

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ uniq -u name.txt

merry

cherry

join命令

格式:

join [option] file1 file2

-用来将来自两个分类文本文件的行连接在一起。

--an, n为一个数字,用于连接时从文件n中显示不匹配行。

--o n.m 连接域,n为文件号,m为域号

--j n m n为文件号,m为域号。使用其他域作连接域。

--t 域分隔符,用来设置非窗或tab键的域分隔符。

split命令

格式:

split -output_file-size input-filename output-filename

--b n  每个分割文件的大小n

--C n  每个分割文件一行最多n字节

--l n 每个分割文件的行数

--n 同-l n

例子:

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ cat lsout.txt | wc -l

18

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ split -6 lsout.txt split

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$  ls -l split* | wc -l

3

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ ls -l split*

-rw-rw-r-- 1 jesson jesson 313  2月  1 20:00 splitaa

-rw-rw-r-- 1 jesson jesson 358  2月  1 20:00 splitab

-rw-rw-r-- 1 jesson jesson 348  2月  1 20:00 splitac

另外,关于合并和分割的命令,其实还有cut和paste,这些命令用法都很相似,可以查看帮助文档查看其详细的用法。

linux 脚本 过滤 词,linux学习之shell脚本 - 文本过滤相关推荐

  1. linux停止jar程序,Linux 启动停止SpringBoot jar 程序部署Shell 脚本的方法

    废话不多说了,先给大家上代码,具体代码如下所示: #!/bin/bash cd `dirname $0` CUR_SHELL_DIR=`pwd` CUR_SHELL_NAME=`basename ${ ...

  2. linux脚本调用db2存储过程,LINUX定时执行含有DB2存储过程的SHELL脚本

    <LINUX定时执行含有DB2存储过程的SHELL脚本>由会员分享,可在线阅读,更多相关<LINUX定时执行含有DB2存储过程的SHELL脚本(6页珍藏版)>请在人人文库网上搜 ...

  3. linux脚本查看系统内存,二个linux下查看内存使用情况的shell脚本()

    摘要 腾兴网为您分享:二个linux下查看内存使用情况的shell脚本(),政务易,悦作业,优化大师,王者荣耀等软件知识,以及单向历app,优路教育app,kimoji,开关电源设计软件,皮皮高清影视 ...

  4. linux启动脚本springboot,Linux 启动停止SpringBoot jar 程序部署Shell 脚本的方法

    废话不多说了,先给大家上代码,具体代码如下所示: #!/bin/bash cd `dirname $0` cur_shell_dir=`pwd` cur_shell_name=`basename ${ ...

  5. linux shc shell脚本_使用shc工具加密shell脚本详解

    Shc可以用来对shell脚本进行加密,可以将shell脚本转换为一个可执行的二进制文件.经过shc对shell脚本进行加密后,会同时生成两种个新的文件,一个是加密后的可执行的二进制文件(文件名以.x ...

  6. datetime报错 sql脚本_Linux中Mysql数据库备份shell脚本编写实例

    学了段时间的Linux,也学习了shell脚本编写的基本命令与语法,现做一个综合案例来详细讲解. 要求:1).每天凌晨备份数据库shaoxiao到/data/backup/db中 2).备份开始和备份 ...

  7. SHELL/SSH基础知识(入门篇)-包含 shell 脚本语言的基本用法、 shell 脚本语言的基本用法、流程控制、函数 function、其它脚本相关工具、数组 array(欢迎留言交流)

    目录 1 shell 脚本语言的基本用法 1.1 shell 脚本注释规范 1.1.1 shell 脚本注释规范 1.1.2 执行(5种) 1.1.3 在远程主机运行本地脚本 1.1.4 检查shel ...

  8. linux脚本是什么语言,Linux学习之Shell脚本语言的优势是什么?

    当我们学习Linux技术的时候,会涉及各种各样的知识和内容,比如说shell脚本语言,我想很多人都会疑惑shell脚本语言有什么优势?为何学习Linux的时候必须学习呢?我们来看看吧. 当命令和程序语 ...

  9. linux shell脚本学习指南,shell脚本学习指南[二](Arnold Robbins Nelson H.F. Beebe著)

    该进入第四章了,刚才看到一个帖子标题:我空有一身泡妞的好本领,但可惜自己是个妞.汗-这个...音乐无国界嘛,这个不应该也没性别界么? 第四章文本处理工具 书中先说明了以下排序的规则,数值的就不用说了, ...

  10. linux php直接输出,linux学习之shell脚本 ------- 输入与输出

    概述 顾名思义,通俗来说异常就是指,那些产生在我们本来斟酌和设定的计划以外的意外情况. 生活中总是会存在各种突发情况,如果没有做好准备,就让人措手不及. 你和朋友约好了明天1起去登山,半道上忽然乌云蔽 ...

最新文章

  1. mysql mgr应用场景_悄悄告诉你 MySQL MGR 牛在哪?
  2. String、StringBuilder、StringBuffer的比较
  3. 英特尔 620 显卡 驱动 七代cpu_英特尔的智能“整体厨房”
  4. d3.js(v5.7)树状图
  5. python显示代码行数_python实现的代码行数统计代码
  6. 南京牵手印度软件 本土软件企业态度不一
  7. MapXtreme2005中关于使用动画图层的一个方法
  8. aix中c语言生成pdf文档,利用PDFLib生成PDF文档
  9. kali2018安装教程_Kali更新安装firefox教程
  10. linux安装rz命令
  11. 傅里叶变换的矩阵分析
  12. chrome pdf 打印边距问题处理
  13. win10 Administrator账户被禁用怎么办?
  14. 龙卷风路径_ae龙卷风路径
  15. 推荐几个在线编程学习的网站,程序员必备
  16. mand-mobile TabPicker 多级联动选择
  17. JS面向对象/继承/原型链/this指向/call方法
  18. MicroPython_ESP8266_IoT——第四回 初入联网(接入了贝壳物联)
  19. 卡方分布上侧α分位数的近似公式及其证明
  20. C++:onnxruntime调用FasterRCNN模型

热门文章

  1. 多线程的坑,不要用sleep
  2. Spring Security - 21 记住我功能
  3. Fruits 360(水果数据集)
  4. 《十二生肖运程图》网站欣赏
  5. 解决执行hive语句时出现虚拟内存不够的问题
  6. 化妆品选购指南_痘痘肌专属
  7. Re.常系数齐次递推
  8. 基于darknet的voc数据集训练和mAP测试
  9. 安装set 安装ptf框架
  10. 零极限:关于蓝色太阳水原理