Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-02-2009, 03:06 PM   #1
LQ Newbie
Registered: Oct 2009
Posts: 5

Rep: Reputation: 0
Bash as input to Fortran

Hi guys,

I have an Fortran 90 program which has two values it needs to read in from the shell.

If there was only one read, then I have found that the following script is possible in bash to automate running this f90 code many times...

echo $input | ./f90program

However, if I have two variables to feed into the f90program, I have found that trying...

echo "$input1 $input2" | ./f90program

...does not work, can anyone suggest a way to solve this minor problem?


Old 11-02-2009, 03:33 PM   #2
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 555

Rep: Reputation: 115Reputation: 115
Perhaps don't quote the input variables?

Or maybe your fortran code wants the two variables on seperate lines? In which case

echo -e "$input1\n$input2" | ./f90program

will work
Old 11-02-2009, 03:39 PM   #3
LQ Newbie
Registered: Oct 2009
Posts: 5

Original Poster
Rep: Reputation: 0
That's perfect, thanks a lot Cantab!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
User input into Bash scripts and checking validity of user input?? helptonewbie Programming 8 07-07-2008 07:40 PM
bash + fortran into .exe would this work TheBrick Programming 10 10-03-2006 07:35 PM
does linux fortran compiler in fedora 4 support VAX FORTRAN? terrence Programming 17 08-31-2005 09:59 AM
my mouse input is takes as keyboard input in BASH e1000 Slackware 5 12-08-2003 04:00 PM
Need help defining Fortran 77 input/output streams using g77! Gethyn Programming 1 08-14-2003 01:42 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration