Why is gfortran on my mac continuously printing 'y' instead of 'Hello'?

  • Topic: Fortran 
  • Thread starter Thread starter Nicolaus
  • Start date Start date
  • Tags Tags
    Gfortran Mac
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
2 replies · 2K views
Nicolaus
Messages
73
Reaction score
0
I just downloaded gfortran on my mac and I'm having an issue running the program.
For example, when I run the following using .f90,

program test
write (*,*) "Hello"
end program test

the computer, seemingly infinitely, spews out y's:
y
y
y
y
y
y
y
..
 
Physics news on Phys.org
This is a guess, but it once caught me out on a Unix system, and the Mac OS is basically unix plus a lot of advertising hype :smile:

There is a unix command called "test" (in fact several different commands all called "test", depending what shell you are running etc). So you might not be running your program at all!

Try renaming it "mytest" or whatever.
 
AlephZero's guess is a very solid one.

Up to my experience every programmer working on *nix-style systems sooner or later runs into this, so
"Welcome to the club, Nikolaus!" :smile: