This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: get_command intrinsic
On Jan 22 2011, Daniel Franke wrote:
Compiled and run (4.4, 4.5, 4.6):
$> ./a.out "foo bar"
./a.out foo bar
0 './a.out'
1 'foo bar'
The string "foo bar" is to be considered a single argument, this is
reflected by the result of GET_COMMAND_ARGUMENT - but the result of
GET_COMMAND implies that there are two arguments, "foo" and "bar, the
quotes are lost.
The F2003 intrinsic GET_COMMAND is decribed as:
"Returns the entire command by which the program was invoked."
Does the current implementation satisfy this requirement, or would it be
necessary to preserve the command line verbatim, i.e. with quotes?
If it is, it's unimplementable!
The line with quotes in is the input to the shell, but they have been
stripped by the shell by the time the program is invoked. Nothing to
do with Fortran.
Regards,
Nick Maclaren.