第一部分:Hadoop Bin后面根据项目的实际需要Hadoop Bin包括:Hadoophadoop的Shellhadoop-config.sh 它的作用是对一些变量进行赋值 HADOOP_HOME(hadoop的安装目录)。 HADOOP_CONF_DIR(hadoop的配置文件目录)。HADO...
分类:
其他好文 时间:
2014-09-29 12:09:37
阅读次数:
169
今天写了一个shell监控的脚本主要通过shell脚本结合zabbix来监控keepalived的运行状态。
直接说脚本
脚本名字:
check_keepalived.sh
#!/bin/bash
UNM=`ps-ef|grepkeepalived|wc-l`
if[$UNM-gt2];thenecho1;elseecho0;fi
于是停止了keepalived进行测试,发现这个返回值是1..
分类:
其他好文 时间:
2014-09-29 02:39:27
阅读次数:
179
最终确定是shell环境问题,临时改为/bin/bash即可查看.1.问题现象# su - jingyu$ iduid=503(jingyu) gid=507(jingyu) groups=507(jingyu)$ ulimit -aulimit: Command not found.2.临时切换为...
分类:
其他好文 时间:
2014-09-29 00:07:16
阅读次数:
252
希尔排序(Shellsort)的名称源于它的发明者Donald Shell,该算法是冲破二次时间屏障的第一批算法之一。不过,自从它最初被发现,又过了若干年才证明了它的亚二次时间界。它通过比较相距一定间隔的元素来工作;各趟比较所用的距离随着算法的进行而减小,直到只比较相邻元素的最后一趟排序为止。希尔排...
分类:
其他好文 时间:
2014-09-28 23:13:15
阅读次数:
251
简单的示例Shell程序示例1.#!/bin/bash
#This is to show what a shell script looks like
echo "Our first example"
echo # This inserts an empty line in output.
echo "We are currently in the following directory."
/b...
分类:
其他好文 时间:
2014-09-28 20:05:46
阅读次数:
266
file1-file2 => file3file1=/data/aaafile2=/data/bbbfile3=/data/cccsort -m $file3
分类:
系统相关 时间:
2014-09-28 19:54:45
阅读次数:
179
问题:出现declare:not found的提示解决:原来,UBUNTU用的是dash(后来证明这个其实这个不是错误的原因:从#!/bin/bash到#!/bin/dash,依旧无法运行,在这写出这一点只为引起以后的注意)只需要用sudo dpkg-reconfigure dash指令然后在出现的...
分类:
其他好文 时间:
2014-09-28 19:48:35
阅读次数:
181
1. 使用grep(结果带括号,不知道有没有办法仅把括号中的内容匹配出来)$a='abc[edg]adfirpqu'$echo $a|grep -o '\[.*\]' #中括号的处理需要转义[edg]$b='abc(edg)adfirpqu'$echo $b|grep -o '(.*)'(edg)....
分类:
其他好文 时间:
2014-09-28 19:40:35
阅读次数:
209
Pig 在 Shell中使用,批量加载处理文件...
分类:
其他好文 时间:
2014-09-28 19:16:54
阅读次数:
167
#!/bin/bash
IP=`awk‘{print$1}‘/home/bash/mima.txt`
foriin$IP
do
{port=`grep$i/home/bash/mima.txt|awk‘{print$2}‘`
pawd=`grep$i/home/bash/mima.txt|awk‘{print$3}‘`
expect<<EOF
spawnssh-p$portroot@$i;
expect{
"(yes/no)?"{send"yes\r"}
"password:"{send"$pa..
分类:
其他好文 时间:
2014-09-28 18:43:36
阅读次数:
133