2 Replies Latest reply: Jun 1, 2007 5:58 AM by 807606 RSS

    java program to run a C compiled file in SHELL unix

    807606
      hi,
      i have two queries,

      1) i have a c program which i compile to get a new file,{a exe file i suppose}, i need to execute it for 2000 times. for that i need to write a java program which can run the file in SHELL unix.

      can you suggest me how to write,

      2) also my file name starts with 0001.mnp to 1989.mnp, how to get 0001 as a number and during increment it should generate as 0002 ..0038 and so on. till 1989.

      the above java program which am goin to write should just take file 0001.mnp and convert it into 0001.bns,
      and get incremented automatically till the file 1989.
        • 1. Re: java program to run a C compiled file in SHELL unix
          800323
          hi,
          i have two queries,

          1) i have a c program which i compile to get a new
          file,{a exe file i suppose}, i need to execute it for
          2000 times. for that i need to write a java program
          which can run the file in SHELL unix.

          can you suggest me how to write,
          Read this: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

          However, you could do this all in a shell script.

          >
          2) also my file name starts with 0001.mnp to
          1989.mnp, how to get 0001 as a number and during
          increment it should generate as 0002 ..0038 and so
          on. till 1989.

          the above java program which am goin to write should
          just take file 0001.mnp and convert it into
          0001.bns,
          and get incremented automatically till the file 1989.
          A loop? What are you having difficulty with?

          Again, this could all be done in a shell script.
          • 2. Re: java program to run a C compiled file in SHELL unix
            807606
            1) i have a c program which i compile to get a new file,{a exe file i suppose}
            No, on Unix the file system stores the permission which declares a file executable. It does not have to adhere to any naming convention in order to become magically executable.