<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
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/"
> <channel><title>Comments on: UNIX Date Command Examples</title> <atom:link href="http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 19:55:56 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Philippe Petrinko</title><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/#comment-60738</link> <dc:creator>Philippe Petrinko</dc:creator> <pubDate>Thu, 14 Jul 2011 15:53:01 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=5579#comment-60738</guid> <description>You confuse [standard input usage] with [parameters on the command line] which are different kind of inputs, which cannot be exchanged.
The genuine way to give parameters to a command is to give them on the program call, which is made on the command line.
There a other ways to achieve parameter passing to a command, such as using a specific file, or using environment variables.
On the other hand, standard input is commonly used to give _data_ to process, not parameters.
As a matter of facts, [date] command does make any use of standard input.
So you can pipe _anything_ you want, [date] won&#039;t ever use it. You might have pipe (with echo) any text, [date] won&#039;t use it.
Make sure by Reading The Fantastic Manual,
by issuing the command: man date
Do you think you get the point?</description> <content:encoded><![CDATA[<p>You confuse [standard input usage] with [parameters on the command line] which are different kind of inputs, which cannot be exchanged.</p><p>The genuine way to give parameters to a command is to give them on the program call, which is made on the command line.</p><p>There a other ways to achieve parameter passing to a command, such as using a specific file, or using environment variables.</p><p>On the other hand, standard input is commonly used to give _data_ to process, not parameters.</p><p>As a matter of facts, [date] command does make any use of standard input.<br
/> So you can pipe _anything_ you want, [date] won&#8217;t ever use it. You might have pipe (with echo) any text, [date] won&#8217;t use it.</p><p>Make sure by Reading The Fantastic Manual,<br
/> by issuing the command: man date</p><p>Do you think you get the point?</p> ]]></content:encoded> </item> <item><title>By: Learner</title><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/#comment-60735</link> <dc:creator>Learner</dc:creator> <pubDate>Thu, 14 Jul 2011 14:24:25 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=5579#comment-60735</guid> <description>Consider  -     echo “–version” &#124; date
here echo “–version” will give the output --version , which will act as an input to date.  .
so we should get date --version.
But we do not get the same output from echo “–version” &#124; date
and date --version. Can you please explain why the output is different.</description> <content:encoded><![CDATA[<p>Consider  &#8211;     echo “–version” | date<br
/> here echo “–version” will give the output &#8211;version , which will act as an input to date.  .<br
/> so we should get date &#8211;version.</p><p>But we do not get the same output from echo “–version” | date<br
/> and date &#8211;version. Can you please explain why the output is different.</p> ]]></content:encoded> </item> <item><title>By: Philippe Petrinko</title><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/#comment-60734</link> <dc:creator>Philippe Petrinko</dc:creator> <pubDate>Thu, 14 Jul 2011 14:20:25 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=5579#comment-60734</guid> <description>Hi Learner,
Right way to give parameters on command line is:
date --version
When you want a program to use some input from a pipe is:
echo &quot;some text used as input&quot; &#124; tr &quot;[[:lower:]]&quot; &quot;[[:upper:]]&quot;
But these are two really different functionalities. They are not equivalent at all, so they cannot yield the same.
-- Philippe</description> <content:encoded><![CDATA[<p>Hi Learner,</p><p>Right way to give parameters on command line is:</p><p>date &#8211;version</p><p>When you want a program to use some input from a pipe is:</p><p>echo &#8220;some text used as input&#8221; | tr &#8220;[[:lower:]]&#8221; &#8220;[[:upper:]]&#8221;</p><p>But these are two really different functionalities. They are not equivalent at all, so they cannot yield the same.</p><p>&#8211; Philippe</p> ]]></content:encoded> </item> <item><title>By: learner</title><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/#comment-60710</link> <dc:creator>learner</dc:creator> <pubDate>Wed, 13 Jul 2011 23:04:17 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=5579#comment-60710</guid> <description>will date --version work in linux? why is the output different that echo &quot;--version&quot; &#124; date</description> <content:encoded><![CDATA[<p>will date &#8211;version work in linux? why is the output different that echo &#8220;&#8211;version&#8221; | date</p> ]]></content:encoded> </item> <item><title>By: priyanka</title><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/#comment-60482</link> <dc:creator>priyanka</dc:creator> <pubDate>Tue, 05 Jul 2011 10:25:23 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=5579#comment-60482</guid> <description>very nice contain in this site..........useful very much in study..............</description> <content:encoded><![CDATA[<p>very nice contain in this site&#8230;&#8230;&#8230;.useful very much in study&#8230;&#8230;&#8230;&#8230;..</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/#comment-46440</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Mon, 15 Mar 2010 18:44:11 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=5579#comment-46440</guid> <description>Title does says &quot;UNIX Date Command Examples&quot; and Linux != UNIX. Nevertheless, your suggestion is accepted :).  Thanks!</description> <content:encoded><![CDATA[<p>Title does says &#8220;UNIX Date Command Examples&#8221; and Linux != UNIX. Nevertheless, your suggestion is accepted :).  Thanks!</p> ]]></content:encoded> </item> <item><title>By: Philippe Petrinko</title><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/#comment-46439</link> <dc:creator>Philippe Petrinko</dc:creator> <pubDate>Mon, 15 Mar 2010 18:19:12 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=5579#comment-46439</guid> <description>@Vivek: Then, would you consider adding some warning/advice/comment to prevent your readers loosing time (and hairs ;-) ).</description> <content:encoded><![CDATA[<p>@Vivek: Then, would you consider adding some warning/advice/comment to prevent your readers loosing time (and hairs ;-) ).</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/#comment-46438</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Mon, 15 Mar 2010 18:15:40 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=5579#comment-46438</guid> <description>@Philippe,
I think I used that one on proprietary AIX or may be on HP-UX UNIX box. The  month field is four characters long, left side. Same goes for the day (2 chars long). It will not work on *GNU coreutils*.  You can try them on  HP-UX or AIX and should provide output as follows:
&lt;pre&gt;mmmm    dd HH:MM&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>@Philippe,</p><p>I think I used that one on proprietary AIX or may be on HP-UX UNIX box. The  month field is four characters long, left side. Same goes for the day (2 chars long). It will not work on *GNU coreutils*.  You can try them on  HP-UX or AIX and should provide output as follows:</p><pre>mmmm    dd HH:MM</pre>]]></content:encoded> </item> <item><title>By: Philippe Petrinko</title><link>http://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/#comment-46436</link> <dc:creator>Philippe Petrinko</dc:creator> <pubDate>Mon, 15 Mar 2010 16:32:44 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=5579#comment-46436</guid> <description>@Vivek - Do you confirm this one ? My date ((GNU coreutils) 6.10) does not like it much.
&lt;code&gt;
date +&#039;%-4.4h %2.1d %H:%M&#039;
&lt;/code&gt;
What does it do on your system?</description> <content:encoded><![CDATA[<p>@Vivek &#8211; Do you confirm this one ? My date ((GNU coreutils) 6.10) does not like it much.<br
/> <code><br
/> date +'%-4.4h %2.1d %H:%M'<br
/> </code><br
/> What does it do on your system?</p> ]]></content:encoded> </item> </channel> </rss>
