Please Kindly Help me with shell script

This is a discussion on Please Kindly Help me with shell script within the Tech Board forums, part of the Community Boards category; Hi all I run my program prog.c in the following way : Code: $ ./prog 1 > output.txt where 1 ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    11

    Please Kindly Help me with shell script

    Hi all

    I run my program prog.c in the following way :

    Code:
    $ ./prog 1 > output.txt
    where 1 is a user defined initial value used by the program.

    But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
    Like
    Code:
    $ ./prog 1 > output1.txt
    $ ./prog 2 > output2.txt
    $ ./prog 3 > output3.txt
    .
    .
    .
    $ ./prog 1000 > output1000.txt
    I know that a shell script (using a for loop and a variable output file name) can be VERY useful.
    But I dont know how to make it.
    PLEASE HELP

    Regards
    Alice

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,649
    Advanced Bash-Scripting Guide

    This should probably be in the Tech Forum, as it's not really C Programming

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. shell script comparison for two file(text) character wise
    By vaibhavs17 in forum Linux Programming
    Replies: 2
    Last Post: 03-01-2010, 12:47 PM
  2. shell script basic question
    By PedroTuga in forum Linux Programming
    Replies: 1
    Last Post: 09-09-2006, 03:24 AM
  3. invoking shell script
    By agoel01 in forum C Programming
    Replies: 1
    Last Post: 12-01-2005, 10:37 AM
  4. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 01:47 PM
  5. Arguements with a shell script
    By Doh in forum Linux Programming
    Replies: 1
    Last Post: 11-28-2002, 01:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21