<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>银河星尘 &#187; shell</title>
	<atom:link href="http://galaxy.ourkernel.com/blog/tag/shell/feed" rel="self" type="application/rss+xml" />
	<link>http://galaxy.ourkernel.com/blog</link>
	<description>Galaxy's World</description>
	<lastBuildDate>Thu, 02 Sep 2010 06:22:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>至今写的最长的Linux管道命令</title>
		<link>http://galaxy.ourkernel.com/blog/200908/628</link>
		<comments>http://galaxy.ourkernel.com/blog/200908/628#comments</comments>
		<pubDate>Thu, 27 Aug 2009 12:42:16 +0000</pubDate>
		<dc:creator>Galaxy</dc:creator>
				<category><![CDATA[Written]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Galaxy_Original]]></category>
		<category><![CDATA[Grid Engine]]></category>
		<category><![CDATA[Note]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://galaxy001.3322.org/blog/200908/628</guid>
		<description><![CDATA[ll -rt ./_log/*.o* &#124;awk '{if($5==84){print $9}}' &#124; perl -ne '/(GP.*Chr.*\.sh)/;print &#34;$1\n&#34;;' &#124; while read a; do find . -name &#34;$a&#34; ;done &#124; while read ss; do qsub -l vf=280M -cwd $ss;done …… 原因嘛，有些计算节点默认的SHELL不是bash，如果没shell-bang就出错到STDOUT： Warning: no access to tty &#40;Bad file descriptor&#41;. Thus no job control in this shell. 也有可能是其他原因，反正就这了…… 后记，这样还是不行。也不知道计算节点的配置到底是出啥问题了。 后后记：结果嘛，# -S /bin/bash Tags: bash, [...]]]></description>
		<wfw:commentRss>http://galaxy.ourkernel.com/blog/200908/628/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>shell版十进制转二进制脚本</title>
		<link>http://galaxy.ourkernel.com/blog/200811/414</link>
		<comments>http://galaxy.ourkernel.com/blog/200811/414#comments</comments>
		<pubDate>Thu, 20 Nov 2008 18:44:19 +0000</pubDate>
		<dc:creator>Galaxy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://galaxysd.3322.org/blog/2008/11/21/shell%e7%89%88%e5%8d%81%e8%bf%9b%e5%88%b6%e8%bd%ac%e4%ba%8c%e8%bf%9b%e5%88%b6%e8%84%9a%e6%9c%ac/</guid>
		<description><![CDATA[http://bbs.chinaunix.net/thread-1074000-1-1.html 十进制转二进制的算法很简单 用2相除至结果为1 , 将余数和最后的1从下向上倒序写 就是结果 网上有的是各种转换的方法 #!/bin/bash # Usage&#40;&#41;&#123; echo &#34;Error!!!&#34; exit 1 &#125; num=$1 m=0 while &#40;&#40;m&#60;${#num}&#41;&#41;;do &#91;&#91; ${num:$m:1} = &#91;0-9&#93; &#93;&#93; &#124;&#124; Usage &#40;&#40;m++&#41;&#41; done &#91;&#91; $# -ne 1 &#124;&#124; $1 == 0* &#93;&#93; &#38;&#38; Usage bin=$&#40; while &#40;&#40;num!=0&#41;&#41;;do b=$&#40;&#40;num%2&#41;&#41; echo -n $b num=$&#40;&#40;num/2&#41;&#41; done &#41; echo -n $1\'s BinCode is: n=${#bin} [...]]]></description>
		<wfw:commentRss>http://galaxy.ourkernel.com/blog/200811/414/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SED入门</title>
		<link>http://galaxy.ourkernel.com/blog/200808/350</link>
		<comments>http://galaxy.ourkernel.com/blog/200808/350#comments</comments>
		<pubDate>Wed, 20 Aug 2008 00:18:07 +0000</pubDate>
		<dc:creator>Galaxy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Note]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://galaxysd.3322.org/blog/2008/08/20/sed%e5%85%a5%e9%97%a8/</guid>
		<description><![CDATA[http://blog.chinaunix.net/u/21908/showart.php?id=1132017 磁针石 联系方式： gmail and gtalk: xurongzhong#gmail.com 参考资料 ＊《Automating UNIX and Linux Administration》之 “A.5 The sed Stream Editor” ＊《LINUX与UNIX SHELL编程指南》第10章 “SED介绍” ＊《AIX命令参考大全》sed 命令 sed 用法介绍 sed是一个非交互性文本流编辑器。它编辑文件或标准输入导出的文本拷贝。Sed可以随意编辑小或大的文件，有许多sed命令用来编辑、删除，并允许做这项工作时不在现场。sed一次性处理所有改变，因而变得很有效，对用户来讲，最重要的是节省了时间。 这里设计的主要内容有： 抽取域。 匹配正则表达式。 比较域。 增加、附加、替换。 基本的sed命令和一行脚本。 无论命令是什么， sed并不与初始化文件打交道，它操作的只是一个拷贝，然后所有的改动如果没有重定向到一个文件，将输出到屏幕。 因为sed是一个非交互性编辑器，必须通过行号或正则表达式指定要改变的文本行。 sed 命令使用两个工作空间来保留修改的行：保留选定行的模式空间和暂时存储行的保留空间。 sed 子命令的一般格式如下： [address-range] function[modifiers] Sed的语法格式： sed [ -n ] Script [ File ... ] sed [ -n ] [...]]]></description>
		<wfw:commentRss>http://galaxy.ourkernel.com/blog/200808/350/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux服务器系统监控框架与MSN、E-mail、手机短信报警的实现</title>
		<link>http://galaxy.ourkernel.com/blog/200807/243</link>
		<comments>http://galaxy.ourkernel.com/blog/200807/243#comments</comments>
		<pubDate>Mon, 07 Jul 2008 17:02:56 +0000</pubDate>
		<dc:creator>Galaxy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[TCP]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://galaxysd.3322.org/blog/?p=243</guid>
		<description><![CDATA[http://blog.s135.com/read.php/354.htm Linux服务器系统监控框架与MSN、E-mail、手机短信报警的实现[原创] [文章作者：张宴 本文版本：v1.0 最后修改：2008.06.25]最近，在我原有的“Linux服务器系统监控程序”基础上，完善了HTTP、TCP、MySQL主动监控与MSN、E-mail、手机短信报警。监控程序以shell和PHP程序编写，以下为主要框架与部分代码： 一、系统监控接口程序（interface.php）具有的报警方式 １、MSN实时报警 ①、监控程序每次检测到故障存在、或者故障恢复，都会发送短消息到管理员的MSN。 发送MSN短消息用了一个PHP类：sendMsg，使用该PHP类发消息，必须将发送、接收双方的MSN加为联系人，发送中文时，先用iconv将字符集转为UTF-8： 引用 $sendMsg-&#62;sendMessage(iconv(&#8220;GBK&#8221;, &#8220;UTF-8&#8243;, $message), &#8216;Times New Roman&#8217;, &#8217;008000&#8242;); ２、手机短信报警 ①、工作日早上10点之前，晚上6点之后，以及周六、周日，监控程序检测到故障，会调用手机短信接口，发送短信给管理员的手机。 ②、如果监控程序多次检测到同一台服务器的同一类故障，只会在第一次检测到故障时发送一条“故障报警”短信。服务器故障恢复后，监控程序会再发送一条“故障恢复”短信。 如果没有手机短信网关接口，可以试试中国移动通信的www.139.com邮箱，具有免费的邮件到达手机短信通知功能，可以将收到的邮件标题以短信的形式发送到手机上。 ３、电子邮件报警 ①、如果监控程序多次检测到同一台服务器的同一类故障，只会在第一次检测到故障时发送一封“故障报警”邮件。服务器故障恢复后，监控程序会再发送一封“故障恢复”邮件。 系统监控接口程序interface.php（核心部分，仅提供部分代码）： view plainprint? &#60;?php //HTTP服务器监控 if (htmlspecialchars($_POST["menu"]) == &#8220;http&#8221;) { $date = htmlspecialchars($_POST["date"]); $ip = htmlspecialchars($_POST["ip"]); $port = htmlspecialchars($_POST["port"]); $status = htmlspecialchars($_POST["status"]);//状态，0表示无法访问，1表示正常，2表示无法访问但能ping通 //&#8230;下一步处理（省略）&#8230; } //TCP服务器监控 if (htmlspecialchars($_POST["menu"]) == &#8220;tcp&#8221;) { $date = [...]]]></description>
		<wfw:commentRss>http://galaxy.ourkernel.com/blog/200807/243/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
