<?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>深度VPS &#187; 文件</title>
	<atom:link href="http://www.deepvps.com/tag/%E6%96%87%E4%BB%B6/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +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>Windows 和 Linux 下生成以当前时间命名的文件</title>
		<link>http://www.deepvps.com/windows-and-linux-generate-a-file-named-the-current-time.html</link>
		<comments>http://www.deepvps.com/windows-and-linux-generate-a-file-named-the-current-time.html#comments</comments>
		<pubDate>Sun, 17 Jul 2011 15:19:56 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[当前时间]]></category>
		<category><![CDATA[文件]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=842</guid>
		<description><![CDATA[在 Windows、Linux 操作系统，分别利用BAT批处理文件和Shell脚本，生成类似“2011071_082905.txt”以“年月日_时分秒”命名的文件。
Windows BAT批处理文件：
@echo off
set time_hh=%time:~0,2%
if /i %time_hh% LSS 10 (set time_hh=0%time:~1,1%)
set filename=%date:~,4%%date:~5,2%%date:~8,2%_%time_hh%%time:~3,2%%time:~6,2%
echo test &#62;&#62; %filename%.txt
Linux Shell 脚本：
#!/bin/sh
echo test &#62;&#62; $(date -d "today" +"%Y%m%d_%H%M%S").txt
]]></description>
			<content:encoded><![CDATA[<p>在 Windows、Linux 操作系统，分别利用BAT批处理文件和Shell脚本，生成类似“2011071_082905.txt”以“年月日_时分秒”命名的文件。</p>
<p>Windows BAT批处理文件：</p>
<pre>@echo off
set time_hh=%time:~0,2%
if /i %time_hh% LSS 10 (set time_hh=0%time:~1,1%)
set filename=%date:~,4%%date:~5,2%%date:~8,2%_%time_hh%%time:~3,2%%time:~6,2%
echo test &gt;&gt; %filename%.txt</pre>
<p>Linux Shell 脚本：</p>
<pre>#!/bin/sh
echo test &gt;&gt; $(date -d "today" +"%Y%m%d_%H%M%S").txt</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/windows-and-linux-generate-a-file-named-the-current-time.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
