24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

$ cat redirect.f<br />

write (6,*) ’This goes to standard output’<br />

write (0,*) ’This goes to standard error’<br />

read (5,*) i<br />

print *,i<br />

end<br />

$ xlf95 redirect.f<br />

** _main === End of Compilation 1 ===<br />

1501-510 Compilation successful <strong>for</strong> file redirect.f.<br />

$ # No redirection. Input comes from the terminal. Output goes to<br />

$ # the screen.<br />

$ a.out<br />

This goes to standard output<br />

This goes to standard error<br />

4<br />

4<br />

$ # Create an input file.<br />

$ echo >stdin 2<br />

$ # Redirect each standard I/O stream.<br />

$ a.out >stdout 2>stderr

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!