<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Thank you for your suggestion in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088916#M123688</link>
    <description>&lt;P&gt;Thank you for your suggestion, Jim and Steve.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;And by the way,&amp;nbsp;DATE_AND_TIME intrinsic only returns time info, I don't aware of any intrinsic can do time calculation. So&lt;/SPAN&gt;&amp;nbsp;what I really want to do is to call Linux shell command "date" to do some time calculation within &amp;nbsp;fortran code, and then get the output time string and use it after. It seems that the most simple way is to redirect output to file and then read it which I am already in use.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2016 17:56:15 GMT</pubDate>
    <dc:creator>Blane_J_</dc:creator>
    <dc:date>2016-01-15T17:56:15Z</dc:date>
    <item>
      <title>Simple Way to Get Shell Command Output</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088909#M123681</link>
      <description>&lt;P&gt;Hi, for t&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;he "SYSTEM" intrinsic only return the exit code of a shell command but not the output from it, so is&amp;nbsp;there any approach to get the output within fortran code ?&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Such as, the current date string returned by shell command "%DATE%" ? I have tried to echo the date string to txt file and then read it, but it's really bothered, are there any simpler ways ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 02:41:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088909#M123681</guid>
      <dc:creator>Blane_J_</dc:creator>
      <dc:date>2016-01-15T02:41:37Z</dc:date>
    </item>
    <item>
      <title>Well if I just wanted the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088910#M123682</link>
      <description>&lt;P&gt;Well if I just wanted the date there is a standard Fortran intrinsic you can call:&amp;nbsp;DATE_AND_TIME&lt;/P&gt;

&lt;P&gt;But in answer to you question it can be done but there isn't a "simple" way. &amp;nbsp;Getting data via text files is one way. Creating or attaching to an existing console window is also possible and reading then reading from its text buffer is another way. The latter requires understanding programming with the windows API.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 10:40:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088910#M123682</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2016-01-15T10:40:44Z</dc:date>
    </item>
    <item>
      <title>Can you show me an example of</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088911#M123683</link>
      <description>&lt;P&gt;Can you show me an example of the way of attarching and then reading from the text buffer of an existing console ? Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 11:56:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088911#M123683</guid>
      <dc:creator>Blane_J_</dc:creator>
      <dc:date>2016-01-15T11:56:07Z</dc:date>
    </item>
    <item>
      <title>Reading the text from a</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088912#M123684</link>
      <description>&lt;P&gt;Reading the text from a console window is non-trivial. At least until you do it once (your way), then reuse the subroutine you wrote. This is additionally problematic when you do not want the console window to hang around. Redirecting&amp;nbsp;"terminal" output to&amp;nbsp;file is much better. And once you have written his subroutine, you can reuse it later.&lt;/P&gt;

&lt;P&gt;For standard types of functions you have the Fortran standard functions as well as the Windows functions (on Windows machines), or equivalent Linux functions on those machines. You can also the C interoperability capability to call C/C++ functions (your own or from various libraries).&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 16:39:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088912#M123684</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-01-15T16:39:04Z</dc:date>
    </item>
    <item>
      <title>Quote:Blane J. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088913#M123685</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Blane J. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Can you show me an example of the way of attarching and then reading from the text buffer of an existing console ? Thanks a lot.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Use Google, enter "console functions windows", no quotes.&lt;/P&gt;

&lt;P&gt;One of the first links will be: &lt;A href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682073(v=vs.85).aspx"&gt;https://msdn.microsoft.com/en-us/library/windows/desktop/ms682073(v=vs.85).aspx&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The function you might want is &lt;A href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms684969(v=vs.85).aspx"&gt;ReadConsoleOutputCharacter&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;However, this also requires you to learn how to get the Windows handle to the console (of interest) screen buffer.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 16:45:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088913#M123685</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-01-15T16:45:16Z</dc:date>
    </item>
    <item>
      <title>The simpler way would be to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088914#M123686</link>
      <description>&lt;P&gt;The simpler way would be to execute a command with a redirect to a file and then read the file. We've supported the standard EXECUTE_COMMAND_LINE for a while now.&lt;/P&gt;

&lt;P&gt;What do you really want to do?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 16:45:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088914#M123686</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-01-15T16:45:20Z</dc:date>
    </item>
    <item>
      <title>Note, #5 will get you access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088915#M123687</link>
      <description>&lt;P&gt;Note, #5 will get you access to the information sitting in the console window and not what may have scrolled off the bottom of the window.&amp;nbsp;(this is what you asked for).&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 16:50:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088915#M123687</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-01-15T16:50:05Z</dc:date>
    </item>
    <item>
      <title>Thank you for your suggestion</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088916#M123688</link>
      <description>&lt;P&gt;Thank you for your suggestion, Jim and Steve.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;And by the way,&amp;nbsp;DATE_AND_TIME intrinsic only returns time info, I don't aware of any intrinsic can do time calculation. So&lt;/SPAN&gt;&amp;nbsp;what I really want to do is to call Linux shell command "date" to do some time calculation within &amp;nbsp;fortran code, and then get the output time string and use it after. It seems that the most simple way is to redirect output to file and then read it which I am already in use.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 17:56:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088916#M123688</guid>
      <dc:creator>Blane_J_</dc:creator>
      <dc:date>2016-01-15T17:56:15Z</dc:date>
    </item>
    <item>
      <title>https://software.intel.com/en</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088917#M123689</link>
      <description>&lt;P&gt;&lt;A href="https://software.intel.com/en-us/node/580486#880ABC94-8A0B-4045-B07D-D8E9A6EC007E" target="_blank"&gt;https://software.intel.com/en-us/node/580486#880ABC94-8A0B-4045-B07D-D8E9A6EC007E&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;No it can return date and time like the name says&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 18:09:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088917#M123689</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2016-01-15T18:09:21Z</dc:date>
    </item>
    <item>
      <title>Blane wants to do date</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088918#M123690</link>
      <description>&lt;P&gt;Blane wants to do date calculations, which indeed there is no Fortran intrinsic for. Given that this is the Windows forum, I would have recommended Windows API routines for doing conversion to and from various date formats, but Blane mentions Linux so I don't know if there's an accessible routine to do that sort of thing. There's probably something in a C library...&lt;/P&gt;

&lt;P&gt;That said, Fortran programmers have been doing date calculations for decades - it's not terribly difficult and I am sure there are examples all over the net.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 18:24:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088918#M123690</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-01-15T18:24:02Z</dc:date>
    </item>
    <item>
      <title>The is a comprehensive and</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088919#M123691</link>
      <description>&lt;P&gt;The is a comprehensive and free set of Fortran date time tools at&amp;nbsp;https://github.com/milancurcic/datetime-fortran ....&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2016 00:52:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088919#M123691</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2016-01-16T00:52:56Z</dc:date>
    </item>
    <item>
      <title>Thank you both. I see, so I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088920#M123692</link>
      <description>&lt;P&gt;Thank you both. I see, so I think the better way is to do the calculation (what ever shell command could do) using user defined subroutine when there's no accessble intrinsic doing the same thing just like "datetime" above. &amp;nbsp;By the way, would fortran plan to have the sort of intrinsic funtion which can retrive output from shell command in the future ?&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2016 09:09:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088920#M123692</guid>
      <dc:creator>Blane_J_</dc:creator>
      <dc:date>2016-01-17T09:09:59Z</dc:date>
    </item>
    <item>
      <title>Not in standard Fortran. It</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088921#M123693</link>
      <description>&lt;P&gt;Not in standard Fortran. It did add EXECUTE_COMMAND_LINE in Fortran 2008, which we support, but capturing the output is not included. (I don't know of similar routines in C that would capture the output.) Redirecting the command output to a file or named pipe and reading it is quite common.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 02:24:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088921#M123693</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-01-18T02:24:01Z</dc:date>
    </item>
    <item>
      <title>A good source of calendar</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088922#M123694</link>
      <description>&lt;P&gt;A good source of calendar functions in Fortran is John Burkardt's calpak library. Look at URL:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://people.sc.fsu.edu/~jburkardt/f_src/calpak/calpak.html" target="_blank"&gt;http://people.sc.fsu.edu/~jburkardt/f_src/calpak/calpak.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 13:18:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Simple-Way-to-Get-Shell-Command-Output/m-p/1088922#M123694</guid>
      <dc:creator>rase</dc:creator>
      <dc:date>2016-01-18T13:18:00Z</dc:date>
    </item>
  </channel>
</rss>

