Where can I find examples of scripts?

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2005
Posts: 24
Reputation: altheastronut is an unknown quantity at this point 
Solved Threads: 0
altheastronut altheastronut is offline Offline
Newbie Poster

Where can I find examples of scripts?

 
0
  #1
Aug 28th, 2005
Hello,

I need to write a script for a program I am running and I have never written on. I don't even know what commands scripts use, or what they even look like. Does anyone know any tutorials or example I could modify to fit my needs? Thanks,

-Al
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,625
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 715
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Where can I find examples of scripts?

 
0
  #2
Aug 28th, 2005
"Script" is a very broad term that typically doesn't apply to C or C++. Can you be more specific?
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 24
Reputation: altheastronut is an unknown quantity at this point 
Solved Threads: 0
altheastronut altheastronut is offline Offline
Newbie Poster

Re: Where can I find examples of scripts?

 
0
  #3
Aug 28th, 2005
I have a random number generator which outputs a file that my program uses. I want to be able to write something so that I don't have to manually execute the random number generator and then manually move the file to where the program need it. Pretty much have the random number generator and the program to run without having me execute them each time. I am only familliar with c++, I do not know any pearl. I hope this is more clear.

-Al
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,625
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 715
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Where can I find examples of scripts?

 
0
  #4
Aug 28th, 2005
Write a separate C++ program that creates the file and places it where you want. Basic automation.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 24
Reputation: altheastronut is an unknown quantity at this point 
Solved Threads: 0
altheastronut altheastronut is offline Offline
Newbie Poster

Re: Where can I find examples of scripts?

 
0
  #5
Aug 28th, 2005
My problem is to have the program execute pretty much indefinitely while I'm away. Pretty much...
Random number--->move file--->run program--->repeat
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 108
Reputation: prog-bman is an unknown quantity at this point 
Solved Threads: 3
prog-bman prog-bman is offline Offline
Junior Poster

Re: Where can I find examples of scripts?

 
0
  #6
Aug 28th, 2005
Here:
  1. while(1)
  2. {
  3. //your code here
  4. }
Join me on IRC:
Server: irc.daniweb.com
Channel: #C++

Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 24
Reputation: altheastronut is an unknown quantity at this point 
Solved Threads: 0
altheastronut altheastronut is offline Offline
Newbie Poster

Re: Where can I find examples of scripts?

 
0
  #7
Aug 28th, 2005
What will that do?
Originally Posted by prog-bman
Here:
  1. while(1)
  2. {
  3. //your code here
  4. }
The program I am running is a Fortran program. What is does is run a simulation. I have a code that outputs a file for the fortran program, and when it has that program I run the simulation. The simulation roughly an hour to run, what I am trying to do is have the program continue to run for about 2 months without me having to execute the program each time. I pretty much want something where I can start it one day, and check on it a week later or something to that extent.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 466
Reputation: winbatch is on a distinguished road 
Solved Threads: 18
winbatch's Avatar
winbatch winbatch is offline Offline
Posting Pro in Training

Re: Where can I find examples of scripts?

 
0
  #8
Aug 28th, 2005
Why are you asking about scripts and fortran in a C++ forum?
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 24
Reputation: altheastronut is an unknown quantity at this point 
Solved Threads: 0
altheastronut altheastronut is offline Offline
Newbie Poster

Re: Where can I find examples of scripts?

 
0
  #9
Aug 28th, 2005
I know essentially no nothing about writing scripts, I was led to believe I could write a script in c++ (the only language I know). All I need to do is execute the fortran program, nothing more than that. From everyone's responses I take it you can't write a script in c++, I'm just trying to figure out what I need to do because I am in the dark. Thanks, sorry for frustrating anyone out there.

-Al
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 36
Reputation: Raven11 is an unknown quantity at this point 
Solved Threads: 1
Raven11 Raven11 is offline Offline
Light Poster

Re: Where can I find examples of scripts?

 
0
  #10
Aug 28th, 2005
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int num = rand();
  9. ofstream cFile;
  10. cFile.open("RanNum.txt");
  11.  
  12. loop:
  13. cFile << num << endl;
  14. goto loop;
  15. }

A very simple way of doing it which can eventualy overload your computer (I think). However, I'm confused how you want to move the file.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC