I am trying to extract the version of fortran compiler using ifort -v
command and then grep it check for version.
However this does not work.
%ifort -v
ifort version 16.0.1
%ifort -v | grep "version"
ifort version 16.0.1
%ifort -v | grep "xyz"
ifort version 16.0.1
It appears as if the output is getting printed irrespective of my pattern. So to test it out I tried the following redirection to null and it still printed. It seems likes the output is not going to the stdout.
%ifort -v > /dev/null
ifort version 16.0.1
%ifort -v 2>/dev/null
ifort: error #10236: file not found: '2'
ifort version 16.0.1
Is it possible that the information i see in shell is actually being written by a different process than the current executing ifort command and thats the reason I am unable to capture it? How can I capture this and grep it?