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

<channel>
	<title>稀饭的国度 &#187; script</title>
	<atom:link href="http://blog.thematice.com/html/ytag/script/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.thematice.com</link>
	<description>发现自己的脑袋不好使了，用blog来记录真的很好用。</description>
	<lastBuildDate>Wed, 01 Feb 2012 05:33:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>使用script记录Linux终端会话</title>
		<link>http://blog.thematice.com/html/y2010/01/27/968/%e4%bd%bf%e7%94%a8script%e8%ae%b0%e5%bd%95linux%e7%bb%88%e7%ab%af%e4%bc%9a%e8%af%9d.html#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25bd%25bf%25e7%2594%25a8script%25e8%25ae%25b0%25e5%25bd%2595linux%25e7%25bb%2588%25e7%25ab%25af%25e4%25bc%259a%25e8%25af%259d</link>
		<comments>http://blog.thematice.com/html/y2010/01/27/968/%e4%bd%bf%e7%94%a8script%e8%ae%b0%e5%bd%95linux%e7%bb%88%e7%ab%af%e4%bc%9a%e8%af%9d.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 15:15:33 +0000</pubDate>
		<dc:creator>稀饭</dc:creator>
				<category><![CDATA[linux shell]]></category>
		<category><![CDATA[Linux tools]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://blog.thematice.com/html/y2010/01/27/968/%e4%bd%bf%e7%94%a8script%e8%ae%b0%e5%bd%95linux%e7%bb%88%e7%ab%af%e4%bc%9a%e8%af%9d.html</guid>
		<description><![CDATA[许多系统管理员都知道保留一个包含各种任务、配置改变等活动日志的重要性。对一些组织而言，保留“我做了这件事”或“约翰做了那件事”的简单日志就已足够；但另一些组织则需要记录所有改变。 对终端输出进行复制粘贴可能非常乏味，我们使用一个叫做script的鲜为人知的程序来解决这个问题，它是大多数Linux产品util-linux软件包的一部分。 script记录会话的一切内容：你输入的内容和你看到的内容。它甚至记录颜色；因此如果你的命令提示符或程序输出中包含颜色，script将记录它。 要使用script，简单执行以下命令： $ script 默认情况下，它向当前目录的typescript文件中写入内容。然后，你输入的一切内容都被记录到那个文件中。要往另一个文件中记录日志，只需使用script/path/to/file命令。 完成记录后，输入exit退出。这个命令将关闭script会话并保存文件。现在你可以使用cat或其它任何程序来检查日志文件。 使用script的缺点在于，它记录所有特殊的字符；因此你输入的文件中将充满控制字符和ANSI转义序列。你可以在script中使用一个非常简单的shell来解决这个问题： $ SHELL=/bin/sh PS1=”$ ” script 使用script时，不要使用交互式程序或处理窗口的程序，如vior top。它们会破坏会话的输出结果。另外，日志文件会记录你使用的任何命令行程序和你完成一项任务所采取的步骤。如果你需要在脚本中编辑一个文件，考虑退出script会话，然后用script –a（它在旧会话后添加新会话）对文件进行编辑后再重新启动会话。 SCRIPT(1) BSD General Commands Manual SCRIPT(1) NAME script &#8211; make typescript of terminal session SYNOPSIS script [-a] [-c COMMAND] [-f] [-q] [-t] [file] DESCRIPTION Script makes a typescript of everything printed on your terminal. It is useful for [...]]]></description>
		<wfw:commentRss>http://blog.thematice.com/html/y2010/01/27/968/%e4%bd%bf%e7%94%a8script%e8%ae%b0%e5%bd%95linux%e7%bb%88%e7%ab%af%e4%bc%9a%e8%af%9d.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

