|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to include shell script in C program
hi
I want to call a shell script in C program the script is : ssh -t user@remote sh /<remote>home/user/<file_name>.sh and other several commands C program : Call this script and the retrive the task that is been done in <file_name>.sh file can any one tell me how to call the script thankx |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
What do you mean by 'retrieve the task'?
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
i am retriving some file that are generated by the shell script <which is running on remote machine> to my own machine from where i am executing the .c file
|
|
#4
|
||||
|
||||
|
So have you been able to execute the script remotely yet? You can do it via the system() call. Try something like this: Code:
system("ssh -t user@remote sh /<remote>home/user/<file_name>.sh");
system("scp user@remote:/path/to/remote_file /path/to/local_file");If you are being allowed to use system(), then that's all that is there to it. If not, you will have to fork and exec. |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
thanks it works
|
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
thanks for the info....
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to use ssh execute other shell script on other host (shell script include nohup)? | orablue | Shell Programming and Scripting | 1 | 11-18-2010 08:46 PM |
| How to include a command in shell script? | sureshcisco | Shell Programming and Scripting | 2 | 09-02-2009 05:50 PM |
| script/program in vi include $? or... | JudoMan | UNIX for Dummies Questions & Answers | 5 | 03-18-2009 10:48 PM |
| How to include shell scripts in one big shell script? | worchyld | Shell Programming and Scripting | 9 | 03-18-2009 12:10 PM |
| Include PERL script with in the unix shell script | ganapati | UNIX for Dummies Questions & Answers | 1 | 04-29-2008 12:18 PM |
|
|