My C++ program creates a nxn matrix with given value. For e.g if the input is 10 it will creates a matrix of 10x10 now what i want is the script should run program and give input values in a variation of 1000. Say first matrix of 1000 then 2000 , 3000 ..... 10000. I tried using for loop but unable to get the correct result. Also the executable is a.out.How should i create a script of this sort
Kindly help...

You cloud use the 'yes' command. For example:

#!/bin/bash
yes '10' | my_program;

Would send the input of 10 to my_program.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.