User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 397,578 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,391 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 654 | Replies: 1
Reply
Join Date: Aug 2007
Posts: 48
Reputation: tonyaim83 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tonyaim83 tonyaim83 is offline Offline
Light Poster

Giving input to a c++ file

  #1  
Oct 22nd, 2007
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...
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Pennsylvania, US
Posts: 37
Reputation: maddog39 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
maddog39 maddog39 is offline Offline
Light Poster

Re: Giving input to a c++ file

  #2  
Oct 24th, 2007
You cloud use the 'yes' command. For example:
  1. #!/bin/bash
  2. yes '10' | my_program;
Would send the input of 10 to my_program.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Shell Scripting Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 4:54 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC