Integrating Linux command Line and C program..


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Integrating Linux command Line and C program..
# 1  
Old 06-17-2008
Integrating Linux command Line and C program..

Hi.. I am pretty new to Linux . Jus joined 2 weeks ago. My problem is I need to design a particular Application which needs to communicate the Value calclulate by a C++ program 2 another computer..I have done a bit of socket programming to acheive this(The 2 computers are connected via LAN ) ..Now is there any way 2 automate this , as in , Can i integrate the socket programming commands ( to run them I have to compile n ru n in the terminal) and the Program,. That is to say , is it possible 4 me 2 jus give an input say run the prog. and it starts running the program and communicates the value 2 ..? ?

Pls reply if u didn't understand

So thats my problem.

thnx

Addy
# 2  
Old 06-17-2008
Once the program is compiled, you can run it over and over, just like in DOS or Windows.
Suppose you compiled a program myprog.cpp -> myprog. It lives in this directory: /path/to/code.

Code:
/path/to/code/myprog

If it accepts arguments via **argv ->
Code:
/path/to/code/myprog arg1 arg2

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Basic Linux command line question

:D:D:D These are list of command i typed on opensuse terminal and evolve lots of doubt around ,that i can't answer. COMMAND 1 linux-xavv:/ # cd COMMAND 2 linux-xavv:~ # Does above command 1 and command two with red labelled sign make different meaning or same . 1 linux-xavv:/... (1 Reply)
Discussion started by: lobsang
1 Replies

2. Shell Programming and Scripting

How to pass command line arguments to awk program?

#!/bin/awk -f BEGIN { FS=":"; } { if ( $7 == "" ) { print $1 ": no password!"; } } I want to execute this program for a particular user to check for his password from the file /etc/passwd (as the input file) and the user details to be given... (1 Reply)
Discussion started by: sri.phani
1 Replies

3. Shell Programming and Scripting

How find Linux version from command line?

Hi, I am looking to extract linux version from /etc/*-release file. I am specifically tring to avoid use of awk command here. would be great if can do done via sed or grep command. Red Hat Enterprise Linux Server release 6.5 (Tikanga) output must be 6 regards, Litu (7 Replies)
Discussion started by: Litu1988
7 Replies

4. Shell Programming and Scripting

Need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line...

Hello, I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be: SRVXPAPI001 ERRO JUN24 07:28:34 1775 REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F ... (8 Replies)
Discussion started by: Ferocci
8 Replies

5. Shell Programming and Scripting

Shell script to input as if from command line to the java program

Hi, We are having a java server which can run on command line and once initiated, it will prompt options to enter from 0 to 5. The java program kickoff respective operation once number is entered between 0 to 5. However i want to always enter "1" and write another shell program wrapper to start... (4 Replies)
Discussion started by: surya5kn
4 Replies

6. UNIX for Dummies Questions & Answers

encountered a command line argument to c program puzzle!

Hi, I hope this is the right place to post this: I have a cprogram written in openCV which reads a video file and does some processing: Here's a relevant code snippet: //just in case you needed to know what libraries I included #include<iostream> #include<opencv/cv.h>... (1 Reply)
Discussion started by: hackmanbsg
1 Replies

7. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

8. UNIX for Dummies Questions & Answers

linux command line admin tool

Dear All, I am new to linux administration. what is the tool that is used to admin the linux server from remote client using telnet session. It can be used on the server also but start from command line with out Xwindows. just like SMIT in AIX. With Regards, Varma. (1 Reply)
Discussion started by: jarkvarma
1 Replies

9. Programming

Command line parameter for C program

I am writing a C program that part of the idea is to using a command line parameter to control not to run certain part of the sub program. I am totally new to C, I do not have any idea how to pass a command line arguments from a C program. Can anyone help ?! Thanks (3 Replies)
Discussion started by: Wing m. Cheng
3 Replies
Login or Register to Ask a Question