Programming :: Passing Input To Program For Test
Apr 13, 2011
I started to run a C++ my program in Linux and I don't know how to test my program that works fine with a text file. This is a project for my uni and to explain more clear, My program is a sample database for modify or add and search and it read data from a binary file and also write into a binary file. I have got an input from my lecture and she said after compiling in Linux I must write:
1-to compile:
Code:
g++ (files with cpp)
2-to see the output:
Code:
./a.out
3-to test with input:
Code:
./a.out < input.txt >
My problem is in step three. What I must write in the command part after" step2" to see the output?
View 3 Replies
ADVERTISEMENT
Nov 12, 2009
I am not sure if that Subject really explains it, basically I have a script that executes a CLI java-applet that requires a passphrase from the user. I can easily execute this by issuing the -p argument followed by the passphrase however that shows up on possible logs or at least on the results of the ' ps ' command. If you do not supply this -p argument it provides a new line with the echo " Enter Passphrase: " and asks for input.
how can I provide a result/input for the Passphrase request and is it still possible to throw this application in the background with the ' & ' following the command? I have seen a few examples that show a /bin/expect that expects a result and sends a command however I would like to refrain from any extra dependencies. Example of Regular Execution of application:
Code:
$ /usr/local/***/**** -u USERNAME -r Default-Realm -f certificate.der
Password:
View 6 Replies
View Related
Aug 27, 2010
How can I to pass a perl variable into html input tag? For example, If a have got a cgi script:
Quote:
use CGI;
use DBI;
my $owner = $cgi->param('owner');
[code]....
How can I to pass $owner variable?
View 1 Replies
View Related
Jun 5, 2009
I am trying to figure out if there is a way to start a process, and while it is running, pass input to it as though it were a stream. Although the subject of this post mentions this question is "language-neutral", specifically, I am trying to do this in Common Lisp. Truly, I am looking for the principles behind the method of doing this, which seem to me as though they would be language neutral.
I have done Google searches, and found nothing relevant to my query. Without using sockets and IP communication, I would like to start a process (let's use the MySQL command-line client, for example) and then in my Common Lisp (CL) program, pass it input like so:
Code:
(format *mysql-client-instance* "SELECT * FROM some_table;")
Simply, how would I go about sending input to an active process as though it were a stream? My thinking is there has to be some way to do it - similar to the Expect superset of Tcl.
View 2 Replies
View Related
May 14, 2010
Are there any security implications in passing a binary unix program a username and password via variables from within a script ?
View 14 Replies
View Related
Mar 9, 2010
I wrote a test program to get the CPU utilisation. I hope to extend it to take cpu utilisation on multi core machines. Hear I used the equation for taking cpu utilisation given at [url] of JmSchanck post. But when I match the output of my program against 'top' and 'system monitor' output it seems quite high. Sometimes cpu utilisation goes more than 100%.
So the given equation in that url is correct? can anyone give me the equation to take CPU utilisation?
Code:
View 3 Replies
View Related
Sep 22, 2010
I'm trying to test whether wget is working still or not. While [ wget is still running ] <----- but how should this look please?
do
codes
done
View 4 Replies
View Related
Jan 30, 2010
I was windering, if you are writing a C program, I don't think you are supposed to commit the .o files and executables. How can you test your program without making a copy outside the git working dir?
View 3 Replies
View Related
Aug 14, 2010
I am creating a 15 integer array which is input from the user and outputted for the.
Ex.
Enter the array values: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Your values are: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Code:
View 4 Replies
View Related
Apr 11, 2010
i have to write a program which checks the information inside a text file to make sure it is all integers and then convert the integers to roman Numerals. My program seems to have a bit of a problem and im not sure where exactly the problem is....
Code:
#include<stdlib.h>
#include<string>
[code]....
View 8 Replies
View Related
May 3, 2010
about 6 months ago i reformatted my computer, and after it was all said and done i lost my audio in the process, well i tried countless times to fix it and every time i go to install realtek AC 97 it pops up during installation saying "the software you are installing has not passed the windows logo testing to verify its compatibility with the windows XP" i have read many forums and i see this is a frequent problem to some folks.
> Mainboard : Dell Computer Corp. 02Y832
> Chipset : Intel i865G
> Processor : Intel Pentium 4 @ 2400 MHz
> Physical Memory : 1024 MB (4 x 256 DDR-SDRAM )
[Code].....
View 1 Replies
View Related
Jul 28, 2010
I want to simulate a serial protocol in user space program to test reception algorithm. The protocol is similar to UART protocol but frame format is different. The duration of 1 bit is 114,46 us. In my main function I'm creating two threads. Tx for simulating transmitting data and Rx for reception data. For measure time I use create_timer() function and signals. Each thread has its own timer and signal handler. Tx timer uses SIGUSR1 and Rx timer uses SIGUSR2. Tx thread sets the global variable and Rx reads it.
The timers are set to sample with 114,46 us period. When they reach this value signal handler should set the flag. Flag is check in thread and some operation are made. When I set the timers period for longer time (100 ms) everything works fine but when I change it to default value (114,46 us) the Rx thread doesn't receive the proper data. I am wondering if the 114,46 timer period is possible to simulate in user space? Whether the time will give me the proper resolution ? Theoretically it should provide 1 ns resolution.
View 3 Replies
View Related
Sep 25, 2010
I have a file with two fields of numbers that I want to use as input for another program.
Code:
The above code does not work, as I think it would take the whole first and second fields as the input for one particular instance of the program 'inputbashangle'. What I want is to get the first two numbers from the first line of the file 'outfailtest', execute 'inputbashangle' with them, then move on to the first two numbers of the second line for all the lines of 'outfailtest'.
View 9 Replies
View Related
Apr 7, 2010
i am trying to write a program which will read input from a text file, check if each line contains any alphabets and then display a message imforming me if there is an alphabet in each line. My text file is formatted in this way...
[Code]....
View 2 Replies
View Related
Jan 11, 2010
Title : Author : Price
France : Mark : 40
Persia : John : 50
how i arranged my database. I am trying to write aprogram which does a search either using Title, Author or both.
[Code]....
but i am still unclear on how i am able to make the program check if either on of the input(either $Title or $Author) is not filled up, and if one of it is not filled up, use the other one which is filled to do a search.
View 6 Replies
View Related
Apr 6, 2011
basically i have to create a simple program with will continually read input from the user until they enter a blank linei know how to read in certain input but not sure how to get it continually in a loop
View 2 Replies
View Related
May 5, 2010
I would like to use Japanese kana (hiragana, katakana, kanji) on Ubuntu but everything that I've tried to get it set up and running isn't working. The Spanish that I have set up is working perfectly so far.
I've read, the SCIM input program should start up automatically when loading a program, it doesn't. When I have it loaded I cannot seem to get the input working.
View 9 Replies
View Related
Nov 18, 2009
I'm using gdb to debug my program. My program requires arguments (e.g., ./prog -dfile).But if I use gdb as in gdb ./prog -dfile, gdb wants to interpret the -d argument. How do I pass an argument to my program via gdb?
View 2 Replies
View Related
Mar 20, 2011
Some programs will take options like this:$ someprogram -orange apple
And other programs will use something like this:
$ otherprogram --orange apple
Is there a "rule" or convention for this in Linux/Unix/OSX?
View 2 Replies
View Related
May 18, 2010
I'm struggling with the issue of passing a vector of a class to itself, here's what state its in now... (tried many variations, but without direction).
Code:
#include <iostream>
#include <string>
[code]...
View 2 Replies
View Related
Aug 21, 2010
I'm trying to work out the best way to achieve the following.
1)php page that grabs data from a local database. (not a problem)
2)It then needs to send this data to a c program/service running on a remote server. (I probably need it to be able to handle 4+ million reocrds in an array)
3) The c service then needs to process the data and send it back to the initial php script that called it. i was hoping this could be in a an array like structure of some kind. 4)update the db with the results.
I was thinking of using gsoap to write a simple c soap service that php can communicate with. Would this be the right way of doing this or would something like sockets in php be a better way of sending this volume of data as an array or struct to linux c socket if thats even possible.
View 3 Replies
View Related
Mar 2, 2010
I'm in doubt whether my dvd burner is working properly. Do you know of a free of charge program to test it fully?
View 2 Replies
View Related
Jan 12, 2011
i'm programming a small tcp client, but i need that the server knows the source ip. My client receives a external connection and forwards, but the ip seen by the server, of course, is the client ip. I would like, change this ip to original source ip.
I don't know how to do this. I tried with the connect and select function.
View 5 Replies
View Related
May 8, 2010
I have a file with around 1000 IP addresses in it and I need to be able to ssh into each one of them, run a single command, and then exit. I already know the ssh command I want to run and it looks like this:
Code:
shpass -p [password] ssh -p 10022 -o StrictHostKeyChecking=no root@[ip variable] 'reboot'
(I know shpass is not good to use and keys are the correct way but I don't have any other options in this scenario.) if these ip addresses were in a .csv file, by themselves with no other information, how would I create a script to do the above command to each ip until the end of the file?
View 8 Replies
View Related
Jun 11, 2010
If I have the following links in HTML
Code:
<a href=lang.php?lang=cymraeg>Cymraeg</a>
<a href=lang.php?lang=english>English</a>
and lang.php has a link to page2.html, how do I pass on the value of the lang parameter from lang.php to page2.html? The value needed is the one passed in to lang.php.
View 3 Replies
View Related
Apr 26, 2010
Below I've presented the declaration, definition and the calling method of a function w.r.t pass by reference:
Declaration
Code:
void getUnpackedMsg (unsigned char &data, unsigned int numberOfBits);
Definition
line 278: Shown in RED
Code:
void packedMessage :: getUnpackedMsg (unsigned char &emptyArray, unsigned int numberOfBits)
{
...
...
printf ("
[code].....
View 3 Replies
View Related
Jan 14, 2009
I cannot for the life of me get this little (simple) script I wrote to work. Here is the entire script:
Code:
#!/bin/bash
ASPECT=`mediainfo $1 |grep "Display aspect ratio" |cut -d : -f 2`
HEIGHT=`echo "320 / $ASPECT" |bc`
SIZE=`echo 320x$HEIGHT`
[code]......
An input filename ($1) is fed into mediainfo, which by the use of grep and cut spits out a single number which is the aspect ratio. This is then divided by bc into 320, which gives the desired height dimension for the file that I want ffmpeg to create for me. Finally, ffmpeg runs using the calculated dimensions... Basically, it's the passing of the $ASPECT variable to bc that seems to fail. It looks like bc won't read the output from the mediainfo line... It always crashes out with:
Code:
(standard_in) 1: illegal character: ^M I've tried doing something even simpler like this to debug by just trying it to display the calculation on the screen:
Code:
#!/bin/bash
ASPECT=`mediainfo $1 |grep "Display aspect ratio" |cut -d : -f 2`
HEIGHT=`echo "320 / $ASPECT" |bc`
echo $HEIGHT
and it does the same, so it's definitely bc that won't accept the output from mediainfo.
View 4 Replies
View Related
Mar 19, 2010
I was trying to make a code for passing variables by reference..here's the code:
#include<iostream>
using namespace std;
void fun(int& ,int& );
int main(){
[Code].....
invalid initialization of non-const reference of type 'int&' from a temporary of type 'int*'
View 9 Replies
View Related
Feb 11, 2011
I have to launch a new thread from my existing main program and pass data to it.
For now the data is simply a string value.
How I go about passing data to a new thread while it is running.
View 5 Replies
View Related
May 23, 2010
I have the following snippet HTML code:
Quote:
<table id="profile">
<tr>...............</tr>
<tr>
<td width="40%">
[Code].....
How can pass values in args[0] and args[1] to Perl/CGI script?
View 2 Replies
View Related