一、IFS介绍Shell脚本中有个变量叫IFS(InternalFieldSeprator),内部域分隔符。完整定义是TheshellusesthevaluestoredinIFS,whichisthespace,tab,andnewlinecharactersbydefault,todelimitwordsforthereadandsetcommands,whenparsingoutputfromcommandsubstitution,andwhenperf..
分类:
其他好文 时间:
2014-08-22 02:51:46
阅读次数:
208
配置主机映射关系
[hadoop@slave03~]$cat/etc/hosts
127.0.0.1localhostlocalhost.localdomainlocalhost4localhost4.localdomain4
10.15.5.200master.hadoop
10.15.5.201slave01.hadoop
10.15.5.202slave02.hadoop
10.15.5.203slave03.hadoop如上有4台主机,每台hosts都已经编..
分类:
其他好文 时间:
2014-08-22 02:49:05
阅读次数:
213
编程语言:机器语言汇编语言高级语言:静态语言:编译型语言强类型(变量)事先转换成可执行格式如:C、C++、JAVA、C#动态语言:解释型语言,onthefly弱类型边解释边执行如:ASP、.NET、PHP、SHELL、python、perl面向过程:shell,C面向对象:JAVA,Python,perl,c++变量:内存空..
分类:
系统相关 时间:
2014-08-22 02:48:55
阅读次数:
253
实现一个自己的shell解释器,其原理比较简单,首先获取用户的输入,通过fork()函数获取两个进程(父子进程),子进程通过execvp()函数继续进行,此时父进程一直在等待子进程的结束,待都结束了就执行了一次shell解释。 1 /*================================...
分类:
系统相关 时间:
2014-08-22 02:42:25
阅读次数:
307
1. dmesg |tail -n 12. objdump -DCI ./a.out示例:$ cat a.cpp#include int main(){ int *pa=NULL; *pa=0; return 0;}$ g++ -g a.cpp$ ./a.out Segmentat...
分类:
其他好文 时间:
2014-08-21 22:44:24
阅读次数:
170
配置前提:安装了nginx和php。并且php也安装了gd支持现在需要做的是让nagios在LNMP环境下也能运行1.首先须需要安装依赖包1.1.安装perlShell>yuminstallperl1.2.安装perlfcgi模块Shell>wgethttp://search.cpan.org/CPAN/authors/id/F/FL/FLORA/FCGI-0.74.tar.gzShell>p..
分类:
移动开发 时间:
2014-08-21 19:42:25
阅读次数:
329
SHELL的类型:1.登录式shell正常通过某终端登录su-su-l2.非登录式shellsu图形终端下打开的命令窗口自动执行的shell脚本bash的配置文件1.全局配置/etc/profile,/etc/profile.d/*.sh,/etc/bashrc2.个人配置~/.bash_profile,~/.bashrcprofile类的文件设定环境变量运行命令或脚本ba..
分类:
系统相关 时间:
2014-08-21 19:38:16
阅读次数:
239
两个文件,从文件b首列查找出等于文件a的行并输出[root@localhost~]#cata1367[root@localhost~]#catb123234345456567678789shell脚本[root@localhost~]#catjieguo#!/bin/bashy=`sed-n‘p‘a|wc-l`#a行数x=`sed-n‘p‘b|wc-l`#b行数for((i=1;i<=$y;i++))dovalue_a=`sed-n${i}pa`#..
分类:
其他好文 时间:
2014-08-21 19:37:17
阅读次数:
197
[root@web~]#netstat-anp|awk‘{print$6}‘|sort|uniq-c|sort-rn172ESTABLISHED59CONNECTED589SYN_RECV15STREAMSYN居然这么高,继续追查是那些ip发出的SYN:[root@tweb~]#netstat-an|grepSYN|awk‘{print$5}‘|awk-F:‘{print$1}‘|sort|uniq-c|sort-nr|more570x.x.x.x(ip就不写出了..
分类:
系统相关 时间:
2014-08-21 19:35:16
阅读次数:
305
find命令find pathname -options [-print -exec -ok ...] -print: find命令将匹配的文件输出到标准输出。 -exec: find命令对匹配的文件运行该參数所给出的shell命令。对应命令的形式为'command' { } \;,注意{ }和\;...
分类:
系统相关 时间:
2014-08-21 19:19:24
阅读次数:
321