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

<channel>
	<title>LinuxSense &#187; Bash</title>
	<atom:link href="http://www.linuxsense.org/archives/tag/bash/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxsense.org</link>
	<description>分享Linux技术的点点滴滴</description>
	<lastBuildDate>Sat, 01 Aug 2009 05:23:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>理解bash的case</title>
		<link>http://www.linuxsense.org/archives/9211.html</link>
		<comments>http://www.linuxsense.org/archives/9211.html#comments</comments>
		<pubDate>Thu, 26 Feb 2009 10:20:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[shell编程]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[case]]></category>

		<guid isPermaLink="false">http://www.linuxsense.org/?p=9211</guid>
		<description><![CDATA[从网上找到的一段代码，对于学习bash的同学理解case想必很有帮助
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
#!/bin/bash
####################################################
# Program:
# File operation
# 1.) Open file 2.) Display file 3.) Edit file 4.) Delete file
# History:
# 2006/11/03 BianYuan First release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221;
echo &#8220;List of item to operate file -&#8221;
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221;

echo &#8220;1). Open a file -&#8221;
echo &#8220;2). Display a file -&#8221;
echo &#8220;3). Edit a file -&#8221;
echo &#8220;4). Delete a file -&#8221;
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221;
read select
case $select in
1)
echo [...]]]></description>
			<content:encoded><![CDATA[<p>从网上找到的一段代码，对于学习bash的同学理解case想必很有帮助<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
#!/bin/bash<br />
####################################################<br />
# Program:<br />
# File operation<br />
# 1.) Open file 2.) Display file 3.) Edit file 4.) Delete file<br />
# History:<br />
# 2006/11/03 BianYuan First release<br />
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin<br />
export PATH<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221;<br />
echo &#8220;List of item to operate file -&#8221;<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221;<br />
<span id="more-9211"></span><br />
echo &#8220;1). Open a file -&#8221;<br />
echo &#8220;2). Display a file -&#8221;<br />
echo &#8220;3). Edit a file -&#8221;<br />
echo &#8220;4). Delete a file -&#8221;<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8221;<br />
read select<br />
case $select in<br />
1)<br />
echo &#8220;do open file operation&#8221;<br />
;;<br />
2)<br />
echo &#8220;do display a file operation&#8221;<br />
;;<br />
3)<br />
echo &#8220;do edit a file operation&#8221;<br />
;;<br />
4)<br />
echo &#8220;do delete a file operation&#8221;<br />
;;<br />
*)<br />
echo &#8220;There is nothing to do!&#8221;<br />
exit 1<br />
;;<br />
esac</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxsense.org/archives/9211.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash的环境变量</title>
		<link>http://www.linuxsense.org/archives/236.html</link>
		<comments>http://www.linuxsense.org/archives/236.html#comments</comments>
		<pubDate>Sat, 02 Aug 2008 04:59:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[shell编程]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[环境变量]]></category>

		<guid isPermaLink="false">http://www.linuxsense.org/?p=236</guid>
		<description><![CDATA[进入bash后，系统可根据你的配置生成一系列的环境变量，这些环境变量可用export命令显示。下面是一些常用的bash环境变量：
$LOGNAME，当前登录的用户名。
$HOME，当前用户的主目录。
$PATH，当前用户的命令搜索路径。
$LANG，当前系统的语言环境。
$TZ，时区
$MAILCHECK，检查新邮件的间隔，单位是秒。
$PS1，命令行提示符。
$PS2，二级命令行提示符，也就是当你的命令行很长，在一行写不下，转到第二行时出现的提示符。
$PWD，当前目录。
]]></description>
			<content:encoded><![CDATA[<p><P>进入bash后，系统可根据你的配置生成一系列的环境变量，这些环境变量可用export命令显示。下面是一些常用的bash环境变量：</P><br />
<P>$LOGNAME，当前登录的用户名。</P><br />
<P>$HOME，当前用户的主目录。</P><br />
<P>$PATH，当前用户的命令搜索路径。</P><br />
<P>$LANG，当前系统的语言环境。</P><br />
<P>$TZ，时区</P><br />
<P>$MAILCHECK，检查新邮件的间隔，单位是秒。</P><br />
<P>$PS1，命令行提示符。</P><br />
<P>$PS2，二级命令行提示符，也就是当你的命令行很长，在一行写不下，转到第二行时出现的提示符。</P><br />
<P>$PWD，当前目录。<BR></P></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxsense.org/archives/236.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bash循环读入文件的每一行并处理</title>
		<link>http://www.linuxsense.org/archives/117.html</link>
		<comments>http://www.linuxsense.org/archives/117.html#comments</comments>
		<pubDate>Mon, 03 Dec 2007 07:10:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[shell编程]]></category>
		<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.linuxsense.org/?p=117</guid>
		<description><![CDATA[bash循环读入文件的每一行并处理
cat afile &#124; while read oneline
do
echo $oneline
done
这只是个简单例子，把文件afile的每一行读入，然后显示出来。
也可以这样(如果行中有空格或者tab则无法使用此方法,不好意思啊,呵呵):
for i in `cat afile`
do
echo $i
done
]]></description>
			<content:encoded><![CDATA[<p>bash循环读入文件的每一行并处理</p>
<p>cat afile | while read oneline<br />
do<br />
echo $oneline<br />
done<br />
这只是个简单例子，把文件afile的每一行读入，然后显示出来。</p>
<p>也可以这样(如果行中有空格或者tab则无法使用此方法,不好意思啊,呵呵):<br />
for i in `cat afile`<br />
do<br />
echo $i<br />
done</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxsense.org/archives/117.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
