﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-回忆之城-随笔分类-shell</title><link>http://www.cnitblog.com/xijia0524/category/8941.html</link><description>生命在于折腾</description><language>zh-cn</language><lastBuildDate>Wed, 09 Dec 2015 12:41:49 GMT</lastBuildDate><pubDate>Wed, 09 Dec 2015 12:41:49 GMT</pubDate><ttl>60</ttl><item><title>【转】关于Shell 脚本中的"[: too many arguments"错误</title><link>http://www.cnitblog.com/xijia0524/archive/2015/12/09/90314.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 09 Dec 2015 02:53:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2015/12/09/90314.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/90314.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2015/12/09/90314.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/90314.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/90314.html</trackback:ping><description><![CDATA[<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">原文出自<a style="color: rgb(51,102,153); text-decoration: none" href="http://ywuchn.spaces.live.com/Blog/cns!2F33043850B92381!532.entry">http://ywuchn.spaces.live.com/Blog/cns!2F33043850B92381!532.entry</a></p>
<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">今天发现Shell脚本中的if语句产生了如题的错误,经检查,发现是因为脚本中的命令生成的结果含有多个单词,而该结果去和一个值比较时产生了如题的错误,不仔细看让人很困惑.下面是从IBM的developerworks 上找到的部分资料:<br />(<a style="color: rgb(51,102,153); text-decoration: none" title="http://www-128.ibm.com/developerworks/cn/linux/shell/bash/bash-2/index.html" href="http://www-128.ibm.com/developerworks/cn/linux/shell/bash/bash-2/index.html"><span style="color: rgb(255,229,83)">http://www-128.ibm.com/developerworks/cn/linux/shell/bash/bash-2/index.html</span></a>)</p>
<blockquote style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">
<p><a style="color: rgb(51,102,153); text-decoration: none"><span style="color: rgb(255,229,83)">字符串比较说明</span></a><br />大多数时候，虽然可以不使用括起字符串和字符串变量的双引号，但这并不是好主意。为什么呢？因为如果环境变量中恰巧有一个空格或制表键，bash 将无法分辨，从而无法正常工作。这里有一个错误的比较示例：<br />if [ $myvar = "foo bar oni" ]<br />then<span class="Apple-converted-space">&nbsp;</span><br />&nbsp;&nbsp;&nbsp;&nbsp; echo "yes"<br />fi<br />在上例中，如果 myvar 等于 "foo"，则代码将按预想工作，不进行打印。但是，如果 myvar 等于 "foo bar oni"，则代码将因以下错误失败：<br />[: too many arguments<br />在这种情况下，"$myvar"（等于 "foo bar oni"）中的空格迷惑了 bash。bash 扩展 "$myvar" 之后，代码如下：<br />[ foo bar oni = "foo bar oni" ]<br />因为环境变量没放在双引号中，所以 bash 认为方括号中的自变量过多。可以用双引号将字符串自变量括起来消除该问题。请记住，如果养成将所有字符串自变量用双引号括起的习惯，将除去很多类似的编程错误。"foo bar oni" 比较<span class="Apple-converted-space">&nbsp;</span><em>应该</em>写成：<span class="Apple-converted-space">&nbsp;</span><br />if [ "$myvar" = "foo bar oni" ]<br />then<span class="Apple-converted-space">&nbsp;</span><br />&nbsp;&nbsp;&nbsp;&nbsp; echo "yes"<br />fi</p><pre style="word-wrap: break-word; white-space: pre-wrap"><a style="color: rgb(51,102,153); text-decoration: none"><strong><span style="color: rgb(255,229,83)">多引用细节</span></strong></a></pre>
<p>如果要扩展环境变量，则必须将它们用<span class="Apple-converted-space">&nbsp;</span><em>双引号</em>、而不是单引号括起。单引号<span class="Apple-converted-space">&nbsp;</span><em>禁用</em><span class="Apple-converted-space">&nbsp;</span>变量（和历史）扩展。<span class="Apple-converted-space">&nbsp;</span><br />以上代码将按预想工作，而不会有任何令人不快的意外出现。</p>
<p>&nbsp;</p></blockquote>
<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">实际上我的程序以前在Solaris上运行,放到Linux上后该命令会输出两行结果, 后一行才是我需要的结果.仿佛这样也不能在if语句中比较.解决方法是通过把第一行结果重定向到null中,这样就只有最后一行了.</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/90314.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2015-12-09 10:53 <a href="http://www.cnitblog.com/xijia0524/archive/2015/12/09/90314.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】XAMPP（Linux版-x86兼容）官网下载</title><link>http://www.cnitblog.com/xijia0524/archive/2015/12/03/90307.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Thu, 03 Dec 2015 07:02:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2015/12/03/90307.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/90307.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2015/12/03/90307.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/90307.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/90307.html</trackback:ping><description><![CDATA[<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">欢迎光临 XAMPP 的 Linux 版&nbsp;（x86 兼容处理器版）<br />顺便提一下：该软件以前被称作 LAMPP，但为了避免误解，我们将其重名命为 &#187;<strong style="font-weight: bold">XAMPP 的 Linux 版</strong>&#171;。所以，如果您在寻找 LAMPP，您就来对地方了。;)</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">如果你遇到任何有关 XAMPP 的问题，敬请与我们联系。这将帮助我们改进 XAMPP，使其更易于使用。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">安装过程仅 4 个步骤</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">步骤 1：下载</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">只需点击下面的链接。下载最新版总是好主意。:)<br />完整的下载列表（老版本）可在 SourceForge 找到。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">详细的 XAMPP 各版本更新记录可在 发布说明 中找到。</p>
<table style="text-align: left; border-left: rgb(221,221,221) 1px solid; text-transform: none; background-color: transparent; text-indent: 0px; border-spacing: 0px; width: 909px; letter-spacing: normal; border-collapse: collapse; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; max-width: 100%; white-space: normal; margin-bottom: 16px; color: rgb(85,85,85); border-top: rgb(221,221,221) 1px solid; word-spacing: 0px; -webkit-text-stroke-width: 0px" border="0" cellspacing="1" cellpadding="0">
<tbody>
<tr valign="top">
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff"><a style="color: rgb(66,139,202); text-decoration: underline" title="" href="http://www.apachefriends.org/download.php?xampp-linux-1.8.2-3-installer.run" data-original-title="">&nbsp;XAMPP Linux 1.8.2</a></td>
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff" align="right">107 MB</td>
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff">Apache 2.4.7, MySQL 5.5.33,&nbsp;<strong>PHP 5.4.22</strong>&nbsp;&amp; PEAR + SQLite 2.8.17/3.7.17 + multibyte (mbstring) support, Perl 5.16.3, ProFTPD 1.3.4c, phpMyAdmin 4.0.9, OpenSSL 1.0.1e, GD 2.0.35, Freetype2 2.4.8, libjpeg 8d, libpng 1.5.9, gdbm 1.8.3, zlib 1.2.3, expat 2.0.1, Sablotron 1.0.3, libxml 2.8.0, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, mod_perl 2.0.8, FreeTDS 0.91, gettext 0.18.1.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.21, mcrypt 2.5.8, mhash 0.9.9.9, eAccelerator 0.9.6.1, cURL 7.30.0, libxslt 1.1.28, libapreq 2.12, FPDF 1.7, bzip 1.0.6, ICU4C Library 4.8.1, APR (1.4.6), APR-utils (1.5.1)<br />MD5 值：ac1d62327ff1d0c2b6d0e60b648e890d</td></tr>
<tr valign="top">
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff"><a style="color: rgb(66,139,202); text-decoration: underline" title="" href="http://www.apachefriends.org/download.php?xampp-linux-x64-1.8.2-3-installer.run" data-original-title="">&nbsp;XAMPP Linux x86_64 1.8.2</a></td>
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff" align="right">111 MB</td>
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff">Apache 2.4.7, MySQL 5.5.33,&nbsp;<strong>PHP 5.4.22</strong>&nbsp;&amp; PEAR + SQLite 2.8.17/3.7.17 + multibyte (mbstring) support, Perl 5.16.3, ProFTPD 1.3.4c, phpMyAdmin 4.0.9, OpenSSL 1.0.1e, GD 2.0.35, Freetype2 2.4.8, libjpeg 8d, libpng 1.5.9, gdbm 1.8.3, zlib 1.2.3, expat 2.0.1, Sablotron 1.0.3, libxml 2.8.0, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, mod_perl 2.0.8, FreeTDS 0.91, gettext 0.18.1.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.21, mcrypt 2.5.8, mhash 0.9.9.9, eAccelerator 0.9.6.1, cURL 7.30.0, libxslt 1.1.28, libapreq 2.12, FPDF 1.7, bzip 1.0.6, ICU4C Library 4.8.1, APR (1.4.6), APR-utils (1.5.1)<br />MD5 值：d191c03329adccd0b30b893437dbfa55</td></tr></tbody></table>
<table style="text-align: left; border-left: rgb(221,221,221) 1px solid; text-transform: none; background-color: transparent; text-indent: 0px; border-spacing: 0px; width: 909px; letter-spacing: normal; border-collapse: collapse; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; max-width: 100%; white-space: normal; margin-bottom: 16px; color: rgb(85,85,85); border-top: rgb(221,221,221) 1px solid; word-spacing: 0px; -webkit-text-stroke-width: 0px" border="0" cellspacing="0" cellpadding="20" width="600">
<tbody>
<tr valign="top">
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff"><a style="color: rgb(66,139,202); text-decoration: underline" title="" href="http://www.apachefriends.org/download.php?xampp-linux-1.8.3-2-installer.run" data-original-title="">&nbsp;XAMPP Linux 1.8.3</a></td>
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff" align="right">121 MB</td>
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff">Apache 2.4.7, MySQL 5.6.14,&nbsp;<strong>PHP 5.5.6</strong>&nbsp;&amp; PEAR + SQLite 2.8.17/3.7.17 + multibyte (mbstring) support, Perl 5.16.3, ProFTPD 1.3.4c, phpMyAdmin 4.0.9, OpenSSL 1.0.1e, GD 2.0.35, Freetype2 2.4.8, libjpeg 8d, libpng 1.5.9, gdbm 1.8.3, zlib 1.2.3, expat 2.0.1, Sablotron 1.0.3, libxml 2.8.0, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, mod_perl 2.0.8, FreeTDS 0.91, gettext 0.18.1.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.21, mcrypt 2.5.8, mhash 0.9.9.9, eAccelerator 0.9.6.1, cURL 7.30.0, libxslt 1.1.28, libapreq 2.12, FPDF 1.7, bzip 1.0.6, ICU4C Library 4.8.1, APR (1.4.6), APR-utils (1.5.1)<br />MD5 checksum: 449e348adaacd0e1ccd417c70d5ca5fb</td></tr>
<tr valign="top">
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff"><a style="color: rgb(66,139,202); text-decoration: underline" title="" href="http://www.apachefriends.org/download.php?xampp-linux-x64-1.8.3-2-installer.run" data-original-title="">&nbsp;XAMPP Linux x86_64 1.8.3</a></td>
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff" align="right">124 MB</td>
<td style="border-bottom: rgb(221,221,221) 1px solid; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-right: rgb(221,221,221) 1px solid; padding-top: 5px" bgcolor="#ffffff">Apache 2.4.7, MySQL 5.6.14,&nbsp;<strong>PHP 5.5.6</strong>&nbsp;&amp; PEAR + SQLite 2.8.17/3.7.17 + multibyte (mbstring) support, Perl 5.16.3, ProFTPD 1.3.4c, phpMyAdmin 4.0.9, OpenSSL 1.0.1e, GD 2.0.35, Freetype2 2.4.8, libjpeg 8d, libpng 1.5.9, gdbm 1.8.3, zlib 1.2.3, expat 2.0.1, Sablotron 1.0.3, libxml 2.8.0, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, mod_perl 2.0.8, FreeTDS 0.91, gettext 0.18.1.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.21, mcrypt 2.5.8, mhash 0.9.9.9, eAccelerator 0.9.6.1, cURL 7.30.0, libxslt 1.1.28, libapreq 2.12, FPDF 1.7, bzip 1.0.6, ICU4C Library 4.8.1, APR (1.4.6), APR-utils (1.5.1)<br />MD5 checksum: 5c18e1fc59c0db32dcffb4693d9e2b66</td></tr></tbody></table>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">注意： 如果您在正运行 McAfee 病毒扫描程序的 Windows 系统中下载这些文件，您可能会遇到误报的病毒警告。这是 McAfee 和 gzip 压缩文件之间的错误，您可以忽略它。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">&nbsp;步骤 2：安装</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">下载后请输入以下命令：<br />进入 Linux shell 并以系统管理员的身份登录：<br />su<br />chmod 755 xampp-linux-1.8.2-installer.run<br />./xampp-linux-1.8.2-installer.run</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">警告： 只允许使用上述命令安装 XAMPP。不要使用任何 Microsoft Windows 工具释放压缩文件，这没有用。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">警告 2： 使用此命令时，已存在的旧版 XAMPP 会被覆盖。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">就这样结束了。XAMPP 被安装在 /opt/lampp 目录下。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">步骤 3：开始运行</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">使用下面的命令开始运行 XAMPP：<br />/opt/lampp/lampp start</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">您应该能在屏幕上看到类似下面的提示信息：</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">Starting XAMPP 1.8.2&#8230;<br />LAMPP: Starting Apache&#8230;<br />LAMPP: Starting MySQL&#8230;<br />LAMPP started.</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">好了。Apache 和 MySQL 正在运行中。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">如果您遇到任何错误信息，请查看 Linux FAQ。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">&nbsp;步骤 4：测试</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">好了，这很简单，但您如何检测所有组件是否正常工作呢？只需在您的浏览器中输入下面的链接即可：</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">http://localhost</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">现在您应该能看到包含一些检测已安装软件的工作状态的链接和一些示例程序的 XAMPP 开始页面。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><a style="color: rgb(66,139,202); text-decoration: underline" title="" href="http://www.xampp.cc/wp-content/uploads/2013/12/xampp-linux.gif" data-original-title=""><img style="border-bottom: 0px; border-left: 0px; max-width: 100%; height: auto; vertical-align: middle; border-top: 0px; border-right: 0px" class="alignnone size-full wp-image-65" alt="xampp-linux" src="http://www.xampp.cc/wp-content/uploads/2013/12/xampp-linux.gif" width="500" height="428" /></a></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">实时艺术示例：一个小型 PHP/GD 程序（从 0.9.6pre1 版起，同时包含一个 flash 的 PHP/Ming 示例，参见屏幕截图）。感谢 Anke Arnold 提供的字体 &#187;AnkeCalligraph&#171;。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">使用说明</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">安全问题（必读！）</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">如前所述，XAMPP 并不适用于生产环境，而仅供开发环境使用。XAMPP 被设置为尽量开放，并提供开发者任何他/她想要的功能。这对于开发环境来说是很棒的，但对于生产环境来说却可能是致命的。<br />这儿有一份 XAMPP 缺乏安全防护的列表：</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">MySQL 管理员（root）没有密码。<br />MySQL 可通过网络访问。<br />ProFTPD 使用&#8220;lampp&#8221;作为用户名&#8220;daemon&#8221;的密码。<br />PhpMyAdmin 可以通过网络访问。<br />示例程序可以通过网络访问。<br />MySQL 和 Apache 在同一个用户名（daemon）下运行。<br />要修正绝大部分的安全薄弱环节，只需执行以下命令：</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">/opt/lampp/lampp security<br />它会启用一个小小的安全检查功能，使您安装的 XAMPP 更安全。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">高级的启动与停止参数</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">0.9.4 版以前的 /opt/lampp/lampp 只能简单地启动或停止 XAMPP。自从 0.9.5 版开始，它学会了很多新的东西。<br />高级的启动与停止参数<br />参数 描述<br />start 启动 XAMPP。<br />stop 停止 XAMPP。<br />restart 重新启动 XAMPP。<br />startapache 只启动 Apache。<br />startssl 启动 Apache 的 SSL 支持。该命令将持续激活 SSL 支持，例如：执行该命令后，如果您关闭并重新启动 XAMPP，SSL 仍将处于激活状态。<br />startmysql 只启动 MySQL 数据库。<br />startftp 启动 ProFTPD 服务器。通过 FTP，您可以上传文件到您的网络服务器中（用户名&#8220;nobody&#8221;，密码&#8220;lampp&#8221;）。该命令将持续激活 ProFTPD，例如：执行该命令后，如果您关闭并重新启动 XAMPP，FTP 仍将处于激活状态。<br />stopapache 停止 Apache。<br />stopssl 停止 Apache 的 SSL 支持。该命令将持续停止 SSL 支持，例如：执行该命令后，如果您关闭并重新启动 XAMPP，SSL 仍将处于停止状态。<br />stopmysql 停止 MySQL 数据库。<br />stopftp 停止 ProFTPD 服务器。该命令将持续停止 ProFTPD，例如：执行该命令后，如果您关闭并重新启动 XAMPP，FTP 仍将处于停止状态。<br />security 启动一个小型安全检查程序。<br />例如：想启用带 SSL 支持的 Apache，只需输入如下命令（以 root 身份）：<br />/opt/lampp/lampp startssl<br />现在您可以通过 SSL 形式的 https://localhost 访问 Apache 服务器了。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp;</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">什么东西放在哪里？</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">什么东西放在哪里？一个很大的问题哦，这里有部分答案！;)<br />重要的文件和目录<br />文件/目录 用途<br />/opt/lampp/bin/ XAMPP 命令库。例如 /opt/lampp/bin/mysql 可执行 MySQL 监视器。<br />/opt/lampp/htdocs/ Apache 文档根目录。<br />/opt/lampp/etc/httpd.conf Apache 配制文件。<br />/opt/lampp/etc/my.cnf MySQL 配制文件。<br />/opt/lampp/etc/php.ini PHP 配制文件。<br />/opt/lampp/etc/proftpd.conf ProFTPD 配制文件。（从 0.9.5 版开始）<br />/opt/lampp/phpmyadmin/config.inc.php phpMyAdmin 配制文件。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">停止 XAMPP</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">想停止 XAMPP，只需输入如下命令：<br />/opt/lampp/lampp stop</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">您现在应该能看到：</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">Stopping LAMPP 1.8.2&#8230;<br />LAMPP: Stopping Apache&#8230;<br />LAMPP: Stopping MySQL&#8230;<br />LAMPP stopped.</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">然后 XAMPP 的 Linux 版就停止运行了。</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px"><strong style="font-weight: bold">卸载</strong></p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">想卸载 XAMPP，只需输入如下命令：<br />rm -rf /opt/lampp</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">卸载完成。:)</p>
<p style="text-align: left; text-transform: none; text-indent: 0px; margin: 0px 0px 15px; letter-spacing: normal; font: 14px/25px 'Microsoft Yahei', 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal; color: rgb(85,85,85); word-spacing: 0px; -webkit-text-stroke-width: 0px">转载请注明：<a style="color: rgb(66,139,202); text-decoration: underline" title="" href="http://www.xampp.cc/" data-original-title="">XAMPP中文组官网</a><span class="Apple-converted-space">&nbsp;</span>&#187;<span class="Apple-converted-space">&nbsp;</span><a style="color: rgb(66,139,202); text-decoration: underline" title="" href="http://www.xampp.cc/archives/62" data-original-title="">XAMPP（Linux版-x86兼容）官网下载</a></p><img src ="http://www.cnitblog.com/xijia0524/aggbug/90307.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2015-12-03 15:02 <a href="http://www.cnitblog.com/xijia0524/archive/2015/12/03/90307.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】XAMPP: Another web server is already running</title><link>http://www.cnitblog.com/xijia0524/archive/2015/12/03/90306.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Thu, 03 Dec 2015 07:01:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2015/12/03/90306.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/90306.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2015/12/03/90306.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/90306.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/90306.html</trackback:ping><description><![CDATA[<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp;nginx 和 xampp 一起使用的时候，如果 nginx先启动，然后 再启动 xampp的时候，就是修改了 http.conf也是会报如果错误<br /></p>
<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"></p>
<div style="text-align: left; text-transform: none; background-color: rgb(231,229,220); text-indent: 0px; margin: 18px 0px; width: 700px; letter-spacing: normal; font: 12px/26px Consolas, 'Courier New', Courier, mono, serif; white-space: normal; color: rgb(51,51,51); overflow: auto; word-spacing: 0px; padding-top: 1px; -webkit-text-stroke-width: 0px" class="dp-highlighter bg_plain">
<div style="padding-left: 45px" class="bar">
<div style="border-left: rgb(108,226,108) 3px solid; padding-bottom: 10px; background-color: rgb(248,248,248); padding-left: 10px; padding-right: 8px; font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; color: silver; padding-top: 3px" class="tools"><strong>[plain]</strong><span class="Apple-converted-space">&nbsp;</span><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://blog.csdn.net/xiaotuni/article/details/49864489#">view plain</a><a style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); border-bottom: medium none; border-left: medium none; padding-bottom: 1px; text-indent: -2000px; margin: 0px 10px 0px 0px; padding-left: 1px; width: 16px; padding-right: 1px; display: inline-block; background-position: 0% 0%; height: 16px; color: rgb(160,160,160); font-size: 9px; border-top: medium none; border-right: medium none; text-decoration: none; padding-top: 1px" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://blog.csdn.net/xiaotuni/article/details/49864489#">copy</a> 
<div style="z-index: 99; position: absolute; width: 18px; height: 18px; top: 533px; left: 468px"><embed id="ZeroClipboardMovie_1" height="18" name="ZeroClipboardMovie_1" type="application/x-shockwave-flash" align="center" pluginspage="http://www.macromedia.com/go/getflashplayer" width="18" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="false" flashvars="id=1&amp;width=18&amp;height=18" wmode="transparent"></div></div></div>
<ol style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; background-color: rgb(255,255,255); list-style-type: decimal; margin: 0px 0px 1px 45px; padding-left: 0px; padding-right: 0px; color: rgb(92,92,92); border-top: medium none; border-right: medium none; padding-top: 0px"><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(255,255,255); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: ; border-right-style: none; padding-top: 0px !important" class="alt"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">liaohb@ubuntu-xtn-&gt;$sudo&nbsp;/opt/lampp/xampp&nbsp;start&nbsp;&nbsp;</span></span></li><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(248,248,248); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: rgb(92,92,92); border-right-style: none; padding-top: 0px !important"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">[sudo]&nbsp;password&nbsp;for&nbsp;liaohb:&nbsp;&nbsp;&nbsp;</span></li><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(255,255,255); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: ; border-right-style: none; padding-top: 0px !important" class="alt"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">Starting&nbsp;XAMPP&nbsp;for&nbsp;Linux&nbsp;5.6.11-1...&nbsp;&nbsp;</span></li><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(248,248,248); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: rgb(92,92,92); border-right-style: none; padding-top: 0px !important"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">XAMPP:&nbsp;Starting&nbsp;Apache...fail.&nbsp;&nbsp;</span></li><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(255,255,255); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: ; border-right-style: none; padding-top: 0px !important" class="alt"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">XAMPP:&nbsp;&nbsp;Another&nbsp;web&nbsp;server&nbsp;is&nbsp;already&nbsp;running.&nbsp;&nbsp;</span></li><li style="list-style-position: outside; border-bottom-style: none; border-left: rgb(108,226,108) 3px solid; padding-bottom: 0px !important; line-height: 18px; background-color: rgb(248,248,248); list-style-type: decimal-leading-zero; margin: 0px; padding-left: 10px !important; padding-right: 3px !important; border-top-style: none; color: rgb(92,92,92); border-right-style: none; padding-top: 0px !important"><span style="border-bottom: medium none; border-left: medium none; padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; color: black; border-top: medium none; border-right: medium none; padding-top: 0px">XAMPP:&nbsp;Starting&nbsp;MySQL...already&nbsp;running.&nbsp;&nbsp;</span></li></ol></div><br style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><br style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px" />
<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"></p>
<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">在网查了一下，原来是因为在&nbsp; xampp 里面有一判断，端口是否已经使用。所要修改一下就可以了。</p>
<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"><img style="border-bottom: medium none; border-left: medium none; max-width: 100%; border-top: medium none; border-right: medium none" alt="" src="http://img.blog.csdn.net/20151116130747558?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" /></p>
<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px"><br /></p>
<p style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/26px Arial; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">修改后保存就，再启动没有问题了。</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/90306.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2015-12-03 15:01 <a href="http://www.cnitblog.com/xijia0524/archive/2015/12/03/90306.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux中cp强制覆盖拷贝</title><link>http://www.cnitblog.com/xijia0524/archive/2015/11/29/90301.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Sat, 28 Nov 2015 16:08:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2015/11/29/90301.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/90301.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2015/11/29/90301.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/90301.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/90301.html</trackback:ping><description><![CDATA[<span style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; float: none; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px">Linux下默认cp命令是有别名(alias cp='cp -i')的,无法强制覆盖,即使你用 -f 参数也无法强制覆盖文件,下面提供两种Linux下cp 覆盖方法.</span><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; float: none; color: red; word-spacing: 0px; -webkit-text-stroke-width: 0px">1) 取消cp的alias,放心这不是永久生效</span><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; float: none; color: red; word-spacing: 0px; -webkit-text-stroke-width: 0px">#unalias cp</span><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; float: none; color: red; word-spacing: 0px; -webkit-text-stroke-width: 0px">#cp a /test/a</span><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" />
<p style="text-align: justify; text-transform: none; background-color: rgb(250,250,252); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-stroke-width: 0px">恢复的方法很简单<br /><span style="color: red">#alias cp='cp -i'</span></p><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; float: none; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px">2) 用 \cp 执行cp命令时不走alias</span><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; float: none; color: red; word-spacing: 0px; -webkit-text-stroke-width: 0px">#\cp a /test/a</span><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; float: none; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px">上面两种是网中人给的解决方案</span><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; float: none; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px">Blinux最开始有自己的方法</span><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><br style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 13px/21px Arial, Helvetica, sans-serif; white-space: pre-wrap; float: none; color: rgb(17,17,17); word-spacing: 0px; -webkit-text-stroke-width: 0px">#yes|cp a /test/a</span><img src ="http://www.cnitblog.com/xijia0524/aggbug/90301.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2015-11-29 00:08 <a href="http://www.cnitblog.com/xijia0524/archive/2015/11/29/90301.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】linux shell实现随机数多种方法（date,random,uuid)</title><link>http://www.cnitblog.com/xijia0524/archive/2015/11/24/90295.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Tue, 24 Nov 2015 10:16:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2015/11/24/90295.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/90295.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2015/11/24/90295.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/90295.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/90295.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 在日常生活中，随机数实际上经常遇到，想丢骰子，抓阄，还有抽签。呵呵，非常简单就可以实现。那么在做程序设计，真的要通过自己程序设计出随机数那还真的不简单了。现在很多都是操作系统内核会提供相应的api，这些原始参数是获取一些计算机运行原始信息，如内存，电压，物理信号等等，它的值在一个时间段可以保证是唯一的了。好了，废话我就不说了。呵呵。&nbsp;&nbsp; shell脚本程序我们有那些获得随机...&nbsp;&nbsp;<a href='http://www.cnitblog.com/xijia0524/archive/2015/11/24/90295.html'>阅读全文</a><img src ="http://www.cnitblog.com/xijia0524/aggbug/90295.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2015-11-24 18:16 <a href="http://www.cnitblog.com/xijia0524/archive/2015/11/24/90295.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux下查看文件是哪个程序生成或正在调用的</title><link>http://www.cnitblog.com/xijia0524/archive/2014/09/18/89766.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Thu, 18 Sep 2014 06:19:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/09/18/89766.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89766.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/09/18/89766.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89766.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89766.html</trackback:ping><description><![CDATA[方法一：<br /><pre style="padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 13px/23px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px" id="answer-content-1268237185" class="answer-text mb-10" accuse="aContent">fuser -v /path/to/file</pre><br />方法二：<br />lsof<br />方法三：<br />
<p>vim 打开core文件，用二进制方式显示，vim命令行中输入 :%!xxd，<br />在80，81行(不同程序不一样)看到程序名，<br />for example</p>
<p>80 00004f0: 612e 6f75 7400 0000 0000 0000 0000 0000&nbsp; a.out...........<br />81 0000500: 2e2f 612e 6f75 7420 0000 0000 0000 0000&nbsp; ./a.out ........ </p>
<p>这个coredump是由./a.out引起的</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89766.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-09-18 14:19 <a href="http://www.cnitblog.com/xijia0524/archive/2014/09/18/89766.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】grep -v '^#'  yum.conf  和 grep  '^[^#]'  yum.conf  区别 </title><link>http://www.cnitblog.com/xijia0524/archive/2014/07/16/89664.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 16 Jul 2014 10:00:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/07/16/89664.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89664.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/07/16/89664.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89664.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89664.html</trackback:ping><description><![CDATA[<strong><span style="color: red">前一个：把#打头的行给删了（空行是以#打头的吗？当然不是）</span><br /><span style="color: red">后一个：匹配出任意非#字符打头的行（当然不包括空行）</span></strong><br /><br />
<p>grep&nbsp;&nbsp; -v&nbsp; '^#'&nbsp;&nbsp; init.d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 可是理解成 先对文件进行&#8217;#&#8216;检查，然后 对整个文件取反（-V 可以理解成非操作）。<br />grep&nbsp; '^[^#]'&nbsp; init.d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #可以理解成，直接对文件进行 非&#8217;#&#8216;开头 查检。</p>
<p>PS : grep -v '^#' init.d | gerp -v ' ^$'&nbsp;&nbsp;&nbsp;&nbsp; 输出不含空行，但有所果是空格还是会出现的。同样<br />grep '^[^#]' init.d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 对有空格的行也不过滤。所以可以认为这两句话是等价的，<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />从书写习惯上来说也好，从阅读习惯上来说也好 我觉的得2种写法比第1种写法来的好的多。</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89664.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-07-16 18:00 <a href="http://www.cnitblog.com/xijia0524/archive/2014/07/16/89664.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】Linux Error: 23: Too many open files in system </title><link>http://www.cnitblog.com/xijia0524/archive/2014/07/02/89640.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 02 Jul 2014 10:13:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/07/02/89640.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89640.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/07/02/89640.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89640.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89640.html</trackback:ping><description><![CDATA[又出現一個錯誤:<br /><br />出現錯誤的時候,DB自動shutdown 了.<br /><br />ORA-00313: open failed for members of log group 2 of thread 1<br />ORA-00312: online log 2 thread 1: '/oradata/oradata2/efa/redo/Log2.ora'<br />ORA-27041: unable to open file<br />Linux Error: 23: Too many open files in system<br />Additional information: 2<br />error 313 detected in background process<br />ORA-00313: open failed for members of log group 2 of thread 1<br />ORA-00312: online log 2 thread 1: '/oradata/oradata2/efa/redo/Log2.ora'<br />ORA-27041: unable to open file<br />Linux Error: 23: Too many open files in system<br />Additional information: 2<br /><br /><br />OS Version:<br />[root@cimfa501 bdump]# uname -a<br />Linux cimfa501 2.4.9-e.34smp #1 SMP Wed Jan 19 23:02:38 CST 2005 i686 unknown<br /><br /><a class="relatedlink" href="http://www.itpub.net/tree/index_1/" target="_blank"><u><font color="#0066cc">Oracle</font></u></a> Version : 8.1.7.4<br /><br />那是不是要調大 max-file的值. 現在是8192 .<br /><br /><br /><strong style="color: #ff0000">echo "xxxxxxx" &gt;/proc/sys/fs/file-max<br /><br />you don't have to reboot box.</strong><br /><br />[root@rhel-vm1 root]# <span style="color: #ff0000"><strong>ulimit -a</strong></span><br />core file size (blocks, -c) 0<br />data seg size (kbytes, -d) unlimited<br />file size (blocks, -f) unlimited<br />max locked memory (kbytes, -l) 4<br />max memory size (kbytes, -m) unlimited<br />open files (-n) 1024<br />pipe size (512 bytes, -p) 8<br />stack size (kbytes, -s) 10240<br />cpu time (seconds, -t) unlimited<br />max user processes (-u) 1600<br />virtual memory (kbytes, -v) unlimited<br />[root@rhel-vm1 root]# ulimit -n 2048<br />[root@rhel-vm1 root]# ulimit -a<br />core file size (blocks, -c) 0<br />data seg size (kbytes, -d) unlimited<br />file size (blocks, -f) unlimited<br />max locked memory (kbytes, -l) 4<br />max memory size (kbytes, -m) unlimited<br />open files (-n) 2048<br />pipe size (512 bytes, -p) 8<br />stack size (kbytes, -s) 10240<br />cpu time (seconds, -t) unlimited<br />max user processes (-u) 1600<br />virtual memory (kbytes, -v) unlimited<br /><br /><br /><span style="color: #ff0000"><strong>检查LINUX的内核参数设置的时候正确</strong></span><br /><br /><span style="color: #ff0000"><strong>Linux有最大打开文件数的限制.发生这个原因是当前这台机器上打开的文件数已经达到了该限制(Unix下文件,Socket,pipe都包括在这个限制中)</strong></span><img src ="http://www.cnitblog.com/xijia0524/aggbug/89640.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-07-02 18:13 <a href="http://www.cnitblog.com/xijia0524/archive/2014/07/02/89640.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】linux 查看 内存条具体信息, 几根内存条 命令</title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/25/89619.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Wed, 25 Jun 2014 04:45:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/25/89619.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89619.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/25/89619.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89619.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89619.html</trackback:ping><description><![CDATA[<p style="padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px"><span style="color: red"><strong>dmidecode | grep -A16 "Memory Device$"</strong></span></p>
<p style="padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px"><span style="color: red"><strong>其中Size: 1024 MB表示此插槽有一根1G的内存，Size: No Module Installed表示此插槽没有插内存</strong></span><br /></p>
<p style="padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/21px tahoma, helvetica, arial; white-space: normal; color: rgb(69,69,69); word-spacing: 0px; padding-top: 0px; -webkit-text-stroke-width: 0px"><br />[root@bf ~]# dmidecode |grep -A16 "Memory Device$"<br />Memory Device<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Array Handle: 0x003C<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Error Information Handle: Not Provided<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Total Width: 72 bits<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Data Width: 64 bits<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size: 1024 MB<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Form Factor: DIMM<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set: 1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Locator: DIMM 1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bank Locator: Bank 1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type: DDR2<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type Detail: Synchronous<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Speed: 266 MHz (3.8 ns)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Not Specified<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Serial Number: Not Specified<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Asset Tag: Not Specified<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Part Number: Not Specified<br />--<br />Memory Device<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Array Handle: 0x003C<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Error Information Handle: Not Provided<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Total Width: 72 bits<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Data Width: 64 bits<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size: No Module Installed<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Form Factor: DIMM<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set: 1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Locator: DIMM 3<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bank Locator: Bank 1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type: DDR2<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type Detail: Synchronous<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Speed: 266 MHz (3.8 ns)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manufacturer: Not Specified<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Serial Number: Not Specified<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Asset Tag: Not Specified<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Part Number: Not Specified</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89619.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-25 12:45 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/25/89619.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】Creating mailbox file: 文件已存在 </title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/23/89617.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Mon, 23 Jun 2014 10:47:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/23/89617.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89617.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/23/89617.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89617.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89617.html</trackback:ping><description><![CDATA[<span style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp;&nbsp; 在linux下samba添加用户时,出现错误:Creating mailbox file: 文件已存在?</span><br style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp; 怎么解决:</span><br style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 原来linux下添加用户后,会在系统里自动加一个邮箱(系统邮箱),路径是:/var/spool/mail/用户名.</span><br style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp;&nbsp;&nbsp;&nbsp; 可以直接用命令#rm -rf /var/spool/mail/用户名</span><br style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 16px/26px 宋体, Arial; word-wrap: break-word; white-space: normal; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-stroke-width: 0px" /><span style="text-align: left; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 16px/26px 宋体, Arial; white-space: normal; float: none; color: rgb(102,102,102); word-spacing: 0px; -webkit-text-stroke-width: 0px">&nbsp;&nbsp; 这样就可以再次添加同一名字的用户.</span><img src ="http://www.cnitblog.com/xijia0524/aggbug/89617.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-23 18:47 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/23/89617.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】 shell 字符串处理汇总（查找，替换等等）</title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/20/89613.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Fri, 20 Jun 2014 05:36:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/20/89613.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89613.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/20/89613.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89613.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89613.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 字符串：简称&#8220;串&#8221;。有限字符的序列。数据元素为字符的线性表，是一种数据的逻辑结构。在计算机中可有不同的存储结构。在串上可进行求子串、插入字符、删除字符、置换字符等运算。字符：计算机程序设计及操作时使用的符号。包括字母、数字、空格符、提示符及各种专用字符等。一般字符的运算包括：第一、找出字符或者字符串的类型，是数字、字母还是其他特定字符，是可打印字符，...&nbsp;&nbsp;<a href='http://www.cnitblog.com/xijia0524/archive/2014/06/20/89613.html'>阅读全文</a><img src ="http://www.cnitblog.com/xijia0524/aggbug/89613.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-20 13:36 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/20/89613.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】Shell乱码文件中的控制字符处理</title><link>http://www.cnitblog.com/xijia0524/archive/2014/06/03/89582.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Tue, 03 Jun 2014 09:01:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/06/03/89582.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89582.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/06/03/89582.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89582.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89582.html</trackback:ping><description><![CDATA[<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left"><strong>一、显示文件中的控制字符</strong></p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">当从其他系统下载文件时，有时要删除整个文件的控制字符（非打印字符），从菜单中捕获一个应用的屏幕输出有时也会将控制字符输出进文件，怎样知道文件中是否有控制字符？使用cat-vfilename命令，屏幕会乱叫，且到处都是一些垃圾字符，这可以确知文件中包含有控制字符，如果有兴趣可以观察一下这些字符以便于更加确认它们是控制字符。一些系统中使用catfilename而不是cat-v来查看非打印字符。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">sed格式为：[address，[address]]l&#8216;l&#8217;意为列表。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">一般情况下要列出整个文件，而不是模式匹配行，因此使用l要从第一到最后一行。模式范围1，$即为此意。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">如果cat一个文件，发现实际上包含有控制字符。</p>
<table style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; width: 217px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; height: 75px; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="line-height: 1.6; font-family: tahoma, 宋体; word-wrap: break-word; font-size: 14px" valign="top">
<p align="left">$cat &#8211;v a.txt</p>
<p align="left">This is the F1 key:^[OP</p>
<p align="left">This is the F2 key:^[OQ</p></td></tr></tbody></table>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">现在运行sed命令，观察输出结果。</p>
<table style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; width: 214px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; height: 97px; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="line-height: 1.6; font-family: tahoma, 宋体; word-wrap: break-word; font-size: 14px" valign="top">
<p align="left">$sed &#8211;n '1,$l' a.txt</p>
<p align="left">This is the F1 key:\033OP$</p>
<p align="left">This is the F2 key:\033OQ$</p>
<p align="left">$</p></td></tr></tbody></table>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">sed找到并显示了两个控制字符。\033代表退格键，OP为F1键值，放在退格键后。第二行也是如此。各系统控制字符键值可能不同，主要取决于其映射方式（例如使用terminfo或termcap）。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">如果要在文本文件中插入控制字符F1键，使用vi查看其键值，操作如下：</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">&#8226;启动vi。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">&#8226;进入插入模式。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">&#8226;按下&lt;Ctrl&gt;键，然后按&lt;v&gt;键（出现a^）。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">&#8226;释放上述两个键。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">&#8226;按下F1键（显示[OP]。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">&#8226;按下&lt;ESC&gt;键（显示F1键值）。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left"><strong>二、处理控制字符</strong></p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">处理这样的控制字符有两种办法（但不一定满足所有情况，具体情况具体实现吧）。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">第一种：直接执行dos2unixa.txt&nbsp; (这只可以处理dos到unix下的换行问题)</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">第二种：使用sed剔除控制字符。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">下面是传送过来的文件（dos.txt）的部分脚本。必须去除所有可疑字符，以便于帐号所有者使用文件。</p>
<table style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; width: 269px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; height: 97px; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="line-height: 1.6; font-family: tahoma, 宋体; word-wrap: break-word; font-size: 14px" valign="top">
<p align="left">$&nbsp; cat -v dos.txt</p>
<p align="left">12332##DISO##45.12^M</p>
<p align="left">00332##LPSO##23.14^M</p>
<p align="left">01299##USPD##34.16^M</p></td></tr></tbody></table>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">可采取以下动作：</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">1)用一个空格替换所有的（##）符号。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">2)删除起始域中最前面的0（00）。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">3)删除行尾控制字符（^M）。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">一些系统中，回车符为^@和^L，如果遇到一些怪异的字符，不必担心，只要是在行尾并且全都相同就可以。按步执行每一项任务，以保证在进行到下一任务前得到理想结果。使用输入文件dos.txt。</p>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">任务1。删除所有的#字符很容易，可以使用全局替换命令。这里用一个空格替换两个或更多的#符号。</p>
<table style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; width: 285px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; height: 97px; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="line-height: 1.6; font-family: tahoma, 宋体; word-wrap: break-word; font-size: 14px" valign="top">
<p align="left">$ &nbsp;sed 's/##*/ /g' dos.txt | cat -v</p>
<p align="left">12332 DISO 45.12^M</p>
<p align="left">00332 LPSO 23.14^M</p>
<p align="left">01299 USPD 34.16^M</p></td></tr></tbody></table>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">任务2。删除所有行首的0。使用^符号表示模式从行首开始，^0*表示行首任意个0。模式s/^0*//g设置替换部分为空，即为删除模式，正是要求所在。</p>
<table style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; width: 283px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; height: 97px; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="line-height: 1.6; font-family: tahoma, 宋体; word-wrap: break-word; font-size: 14px" valign="top">
<p align="left">$&nbsp; sed 's/^0*/ /g' dos.txt | cat -v</p>
<p align="left">&nbsp;12332##DISO##45.12^M</p>
<p align="left">&nbsp;332##LPSO##23.14^M</p>
<p align="left">&nbsp;1299##USPD##34.16^M</p></td></tr></tbody></table>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">任务3。最后去除行尾^M符号，为此需做全局替换。设置替换部分为空。模式为：&#8216;s/^m//g&#8217;，注意&#8216;^M&#8217;，这是一个控制字符。要产生控制字符（^M），需遵从前面产生F1键同样的处理过程。步骤如下；键入seds/，然后按住&lt;Ctrl&gt;键和v键，释放v键，按&lt;return&gt;键。下面命令去除行尾^M字符。</p>
<table style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; width: 280px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; height: 97px; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="line-height: 1.6; font-family: tahoma, 宋体; word-wrap: break-word; font-size: 14px" valign="top">
<p align="left">$&nbsp; sed 's/^M//g' dos.txt | cat -v</p>
<p align="left">12332##DISO##45.12</p>
<p align="left">00332##LPSO##23.14</p>
<p align="left">01299##USPD##34.16</p></td></tr></tbody></table>
<p style="widows: 2; text-transform: none; background-color: rgb(239,239,239); text-indent: 0px; letter-spacing: normal; font: 14px/22px tahoma, 宋体; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" align="left">分步测试预想功能对理解整个过程很有帮助。用sed在移到下一步前测试本步功能及结果很重要。如果不这样，可能会有一大堆包含怪异字符的意料外的结果。</p><img src ="http://www.cnitblog.com/xijia0524/aggbug/89582.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-06-03 17:01 <a href="http://www.cnitblog.com/xijia0524/archive/2014/06/03/89582.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】Header V3 DSA signature: NOKEY, key ID </title><link>http://www.cnitblog.com/xijia0524/archive/2014/05/29/89576.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Thu, 29 May 2014 03:18:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/05/29/89576.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89576.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/05/29/89576.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89576.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89576.html</trackback:ping><description><![CDATA[<span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">rpm -ivh *.rpm</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">结果出现: V3 DSA signature: BAD, key ID....</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">package *.rpm is not installed</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">在网上查询,有的说是检验错误,需要重新下载,但郁闷的是上一次系统的这些软件都好好的,怎么会一下</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">子全部校验错误呢?</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">最后在网上看到了另一种方法: 错误解决办法 在rpm 命令后添加 --force --nodeps也就是强制进行安装</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">（强制安装还是没有保证的&#8230;&#8230;尽量别用！）</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">后来我在一个网站上看到了一段这样的话：</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: red; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">从 RPM 版本 4.1 开始，在安装或升级软件包时会检查软件包的签名。如果签名校验失败，你就会看到如下所示</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">的错误消息：</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: red; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">error: V3 DSA signature: BAD, key ID 0352860f</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">如果它是新的、只针对文件头的签名，你会看到如下所示的错误消息：</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">error: Header V3 DSA signature: BAD, key ID 0352860f</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">如果你没有安装合适的钥匙来校验签名，消息中就会包含 NOKEY ，如：</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">warning: V3 DSA signature: NOKEY, key ID 0352860f</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">在CentOS下有的时候用yum安装软件的时候最后会提示：</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">引用</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID*****</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">这是由于yum安装了旧版本的GPG keys造成的，解决办法就是</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">引用</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: red; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">#rpm --import /etc/pki/rpm-gpg/RPM*</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">再安装软件就不会有这个错误提示了。</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">-</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; font: 14px/21px simsun; white-space: normal; orphans: 2; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: red; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">另外rpm -ivh --nosignature ufs-utils*.rpm #用参数nosignature的意思是读取时不校验打包或头部签名，这个也可以解决，</span><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(205,216,219); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/21px simsun; white-space: normal; orphans: 2; float: none; color: rgb(70,70,70); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">只是需要你每次安装都输入。</span><img src ="http://www.cnitblog.com/xijia0524/aggbug/89576.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-05-29 11:18 <a href="http://www.cnitblog.com/xijia0524/archive/2014/05/29/89576.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】shell 中 判断mysql的某个数据库中的某个表是否存在</title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/28/89519.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Mon, 28 Apr 2014 07:54:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/28/89519.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89519.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/28/89519.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89519.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89519.html</trackback:ping><description><![CDATA[<pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="best-content-1373664239" class="best-text mb-10" accuse="aContent">v=$(mysql -u$user -p$pass -D $db -e "select count(*) from user;")<br />判断 host 是否为0 就可以<br />if [ $v -eq 0 ]<br />then  echo "NOT EXISTS"<br />fi</pre> <img src ="http://www.cnitblog.com/xijia0524/aggbug/89519.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-28 15:54 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/28/89519.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转shell中EOF的作用】</title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/27/89505.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Sun, 27 Apr 2014 08:17:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/27/89505.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89505.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/27/89505.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89505.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89505.html</trackback:ping><description><![CDATA[<pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="best-content-1300706873" class="best-text mb-10" accuse="aContent">这是 Here document 用法<br />EOF本意是 End Of File，表明到了文件末尾。<br /> <br />使用格式基本是这样的： <br />命令 &lt;&lt; EOF<br />  内容段<br />EOF<br />将&#8220;内容段&#8221;整个作为命令的输入。<br />你的代码里就是用cat命令读入整段字符串并赋值给list变量。<br />其实，不一定要用EOF，只要是&#8220;内容段&#8221;中没有出现的字符串，都可以用来替代EOF，只是一个起始和结束的标志罢了。<br /> <br />有个特殊用法不得不说：<br />: &lt;&lt; COMMENTBLOCK<br />   shell脚本<a style="color: rgb(45,100,179); text-decoration: none" class="inner-link decor-none" href="http://zhidao.baidu.com/search?word=%E4%BB%A3%E7%A0%81%E6%AE%B5&amp;fr=qb_search_exp&amp;ie=utf8" rel="nofollow" target="_blank" log="pos:innerLink" data-word="0">代码段</a><br />COMMENTBLOCK<br />这个用来注释整段脚本代码。 : 是shell中的空语句。<br /> </pre><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(241,254,221); text-indent: 0px; margin: 0px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" accuse="aRA">如果就一行，那么直接赋值即可：<br />list="usr/local/Trolltech/QtEmbedded-4.6.3-arm/examples/widgets/wiggly/wiggly"<br /> <br />EOF相当于读文件的方式，适用于多行内容的操作。</pre> <img src ="http://www.cnitblog.com/xijia0524/aggbug/89505.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-27 16:17 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/27/89505.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】shell 字符串处理汇总（查找，替换等等） </title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/20/89478.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Sun, 20 Apr 2014 10:35:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/20/89478.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89478.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/20/89478.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89478.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89478.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 字符串：简称&#8220;串&#8221;。有限字符的序列。数据元素为字符的线性表，是一种数据的逻辑结构。在计算机中可有不同的存储结构。在串上可进行求子串、插入字符、删除字符、置换字符等运算。字符：计算机程序设计及操作时使用的符号。包括字母、数字、空格符、提示符及各种专用字符等。一般字符的运算包括：第一、找出字符或者字符串的类型，是数字、字母还是其他特定字符，是可打印字符，...&nbsp;&nbsp;<a href='http://www.cnitblog.com/xijia0524/archive/2014/04/20/89478.html'>阅读全文</a><img src ="http://www.cnitblog.com/xijia0524/aggbug/89478.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-20 18:35 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/20/89478.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】通过SHELL脚本修改帐号密码</title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/20/89476.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Sun, 20 Apr 2014 04:53:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/20/89476.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89476.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/20/89476.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89476.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89476.html</trackback:ping><description><![CDATA[<p style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px/19px Verdana; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">近日遇到一个任务：通过shell自动为许多Linux帐号修改密码。我对这个不熟，在网上查阅了相关资料，以下为笔记：</p>
<p style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px/19px Verdana; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">单个修改：</p><pre style="border-left: rgb(204,204,204) 3px solid; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(0,0,0); text-indent: 0px; margin: 0px 20px; padding-left: 1em; letter-spacing: normal; padding-right: 1em; font: 12px/19px 'Courier New'; word-wrap: break-word; orphans: 2; color: rgb(0,255,0); word-break: break-all; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="prettyprint">echo test:23456 | chpasswd</pre>
<p style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px/19px Verdana; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">批量修改：</p>
<p style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px/19px Verdana; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">先在一个文本文件中（假设名叫users.txt）准备帐号信息，格式是&#8220;帐号:密码&#8221;，每行一个，然后执行命令：</p><pre style="border-left: rgb(204,204,204) 3px solid; padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(0,0,0); text-indent: 0px; margin: 0px 20px; padding-left: 1em; letter-spacing: normal; padding-right: 1em; font: 12px/19px 'Courier New'; word-wrap: break-word; orphans: 2; color: rgb(0,255,0); word-break: break-all; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="prettyprint">chpasswd &lt; users.txt</pre>
<p style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px/19px Verdana; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">执行成功后，记得删除这个users.txt。</p>
<p style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px/19px Verdana; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">批量修改的方法稍稍麻烦一点，不过安全度更高一点点。因为，在shell中出现明文密码不是好习惯。</p>
<p style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px/19px Verdana; white-space: normal; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">还有其他的办法，但不是太麻烦就是对Linux发行版有依赖，所以以上的办法是最适合我的。</p> <img src ="http://www.cnitblog.com/xijia0524/aggbug/89476.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-20 12:53 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/20/89476.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】shell脚本通过ifconfig -a命令获得某一IP对应的接口</title><link>http://www.cnitblog.com/xijia0524/archive/2014/04/20/89475.html</link><dc:creator>回忆之城</dc:creator><author>回忆之城</author><pubDate>Sun, 20 Apr 2014 04:51:00 GMT</pubDate><guid>http://www.cnitblog.com/xijia0524/archive/2014/04/20/89475.html</guid><wfw:comment>http://www.cnitblog.com/xijia0524/comments/89475.html</wfw:comment><comments>http://www.cnitblog.com/xijia0524/archive/2014/04/20/89475.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/xijia0524/comments/commentRss/89475.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/xijia0524/services/trackbacks/89475.html</trackback:ping><description><![CDATA[方法一：<br /><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" id="answer-content-991616775" class="answer-text mb-10" accuse="aContent"> #! /bin/bash<br />  i=`ifconfig -a |grep "Link encap"|awk '{print $1}'`<br />  for i in $i<br />  do<br />  echo "$i"<br />  echo "`ifconfig $i |grep "inet addr:" |awk '{print $2}'|awk -F: '{print $2}'    `"<br />  let i++<br />  done</pre><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="answer-text mb-10" accuse="aContent">确定网卡命令直接取即为：</pre><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="answer-text mb-10" accuse="aContent"><span style="color: red"><strong>ifconfig eth0 |grep "inet addr:" |awk '{print $2}'|awk -F: '{print $2}'</strong></span></pre><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="answer-text mb-10" accuse="aContent"><span style="color: red"><strong>ifconfig eth0 |grep "inet addr:" |awk '{print $2}'|awk -F: '{print $2}' |awk -F. '{print $4}' </strong></span></pre><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="answer-text mb-10" accuse="aContent">方法二：</pre><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="answer-text mb-10" accuse="aContent"><span style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/22px song, Verdana; white-space: normal; orphans: 2; float: none; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我的机器是as4,ifconfig 输出的结果和你的不太一样，我按照我的输出结果写了个awk脚本，仅供参考。</span><br style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/22px song, Verdana; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; font: 14px/22px song, Verdana; word-wrap: break-word; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/22px song, Verdana; white-space: normal; orphans: 2; float: none; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">awk.sc</span></pre><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="answer-text mb-10" accuse="aContent">BEGIN{RS="\n\n"}<br />{<br />&nbsp; for(i = 1;i&lt; NF; i++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(($i ~ /MTU/)&amp;&amp;($1 != "lo"))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res[$1]=substr($i,5)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />}<br />END{<br />for(a in res)<br />&nbsp;print a,res[a]<br />}</pre><pre style="padding-bottom: 0px; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px 0px 10px; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px/24px arial, 'courier new', courier, 宋体, monospace; word-wrap: break-word; white-space: pre-wrap; orphans: 2; color: rgb(51,51,51); word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="answer-text mb-10" accuse="aContent"><span style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/22px song, Verdana; white-space: normal; orphans: 2; float: none; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">ifconfig输出结果<br /><p>eth0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Link encap:Ethernet&nbsp; HWaddr 00:0C:29:24:7E:73&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inet addr:192.168.5.8&nbsp; Bcast:192.168.5.255&nbsp; Mask:255.255.255.0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inet6 addr: fe80::20c:29ff:fe24:7e73/64 Scope:Link<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UP BROADCAST RUNNING MULTICAST&nbsp; MTU:1500&nbsp; Metric:1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX packets:1202 errors:0 dropped:0 overruns:0 frame:0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TX packets:969 errors:0 dropped:0 overruns:0 carrier:0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collisions:0 txqueuelen:1000 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX bytes:108326 (105.7 KiB)&nbsp; TX bytes:155456 (151.8 KiB)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Interrupt:67 Base address:0x2024 </p><p>lo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Link encap:Local Loopback&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inet addr:127.0.0.1&nbsp; Mask:255.0.0.0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inet6 addr: ::1/128 Scope:Host<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UP LOOPBACK RUNNING&nbsp; MTU:16436&nbsp; Metric:1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX packets:2132 errors:0 dropped:0 overruns:0 frame:0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TX packets:2132 errors:0 dropped:0 overruns:0 carrier:0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collisions:0 txqueuelen:0 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RX bytes:3106880 (2.9 MiB)&nbsp; TX bytes:3106880 (2.9 MiB)</p><span style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px/22px song, Verdana; white-space: normal; orphans: 2; float: none; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">执行结果<br />$ /sbin/ifconfig |awk -f awk.sc&nbsp;&nbsp;&nbsp; <br />eth0 1500</span></span></pre> <img src ="http://www.cnitblog.com/xijia0524/aggbug/89475.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/xijia0524/" target="_blank">回忆之城</a> 2014-04-20 12:51 <a href="http://www.cnitblog.com/xijia0524/archive/2014/04/20/89475.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>