Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 61139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:16:19+00:00 2026-05-10T18:16:19+00:00

My $SHELL is tcsh. I want to run a C shell script that will

  • 0

My $SHELL is tcsh. I want to run a C shell script that will call a program many times with some arguments changed each time. The program I need to call is in Fortran. I do not want to edit it. The program only takes arguments once it is executed, but not on the command line. Upon calling the program in the script, the program takes control (this is where I am stuck currently, I can never get out because the script will not execute anything until after the program process stops). At this point I need to pass it some variables, then after several iterations I will need to Ctrl+C out of the program and continue with the script.

How can this be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:16:20+00:00Added an answer on May 10, 2026 at 6:16 pm

    To add to what @Toybuilder said, you can use a ‘here document’. I.e. your script could have

    ./myfortranprogram << EOF first line of input second line of input EOF 

    Everything between the ‘<<EOF‘ and the ‘EOF‘ will be fed to the program’s standard input (does Fortran still use ‘read (5,*)’ to read from standard input?)

    And because I think @ephemient’s comment deserves to be in the answer:

    Some more tips: <<‘EOF’ prevents interpolation in the here-doc body; <<-EOF removes all leading tabs (so you can indent the here-doc to match its surroundings), and EOF can be replaced by any token. An empty token (<<”) indicates a here-doc that stops at the first empty line.

    I’m not sure how portable those ones are, or if they’re just tcsh extensions – I’ve only used the <<EOF type ‘here document’ myself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a shell script that, when run, will set some environment
I'm writing a shell script (tcsh) that is supposed to received 3 parameters or
In shell script, how do I iterate through each line in an ASCII file
var shell = function (method) { window[method].apply(null, Array.prototype.slice.call(arguments, 1)); }; shell('alert', 'monkey!');
I have created a tcsh shell script as follows: #!/bin/tcsh setenv PATH setenv PATH
I am writing a shell script to run under the KornShell (ksh) on AIX.
I have a Bash shell script that invokes a number of commands. I would
I primarily program in Linux, using tcsh shell. By default, my current directory is
My shell script looks something like this... if [[ $uptime -lt 0 ]];then some
Shell scripting newbie here. Just wanted some input on my shell script. I basically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.