Sponsored Content
Top Forums Programming How to include shell script in C program Post 302079781 by blowtorch on Wednesday 12th of July 2006 09:57:26 PM
Old 07-12-2006
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.
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

shell script program

shell script for sorting,searchingand insertion/deletion of elements in a list (1 Reply)
Discussion started by: jayaram_miryabb
1 Replies

2. Shell Programming and Scripting

how to include spreadsheet::ParseExcel in shell script

Please tell me that how can we include Spreadsheet::ParseExcel module in shell script (1 Reply)
Discussion started by: akash
1 Replies

3. Shell Programming and Scripting

How to include RETURN KEY with Background process "&" in Shell Script

Hello All, I am a newbie in Shell script programming, and maybe you can help me with my query. I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script. The mntServer.ksh script contains: #!/bin/ksh... (1 Reply)
Discussion started by: racbern
1 Replies

4. UNIX for Dummies Questions & Answers

Include PERL script with in the unix shell script

Hi Gurus, Is it possible to include perl script with in the unix shell script? What would be the general syntax? In the above case, is it required to write the below first two lines of codes? #!usr/bin/sh -x #!usr/bin/perl -w Thanks in advance / Mysore Ganapati. (1 Reply)
Discussion started by: ganapati
1 Replies

5. UNIX for Dummies Questions & Answers

script/program in vi include $? or...

Hi. When you write a script/program in vi Do you include the $ Eg. #!/bin/bash $ echo "Today's date is `date`" or echo "Today's date is `date`" Make your script executable. $chmod +x script I included that. I keep getting a permission denied... why? Thanks! (5 Replies)
Discussion started by: JudoMan
5 Replies

6. Shell Programming and Scripting

How to include a command in shell script?

# dbc "delete from alert;" DELETE 10 # However, the script created below generates an error that command does not exits. Can any one please exist. script.sh: #!/bin/sh dbc "delete from alert;" >>$TASKLOGFILE ./script.sh: line 38: dbc: command not found can any one please... (2 Replies)
Discussion started by: sureshcisco
2 Replies

7. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

8. Shell Programming and Scripting

shell script program

shell script in Unix/Linux to find the lines numbers of a text file are having word which is 5 to 10 characters long and having first letter as a capital letter. (3 Replies)
Discussion started by: usersnehal
3 Replies

9. Shell Programming and Scripting

Apache Hosting-Shell Script - external files include

Hi there Well, it's my first time on this board, so short to myself: I'm matibaski, working as a webdeveloper and also as a system administrator on ubuntu server machines. The problem: I created a small apache-hostingscript by myself and it works fine. But after some addings and new... (1 Reply)
Discussion started by: matibaski
1 Replies

10. Shell Programming and Scripting

How to include menu based options in Shell script?

Hi Friends, I have a menu based tool which requires input/option to proceed further. How to make a shell script ? eg: menu looks like Get_data.sh to continue (y/n) : Here I need to key in "y" to proceed. I want to prepare a script which should consider option y. (5 Replies)
Discussion started by: suresh3566
5 Replies
FTP_NB_PUT(3)								 1							     FTP_NB_PUT(3)

ftp_nb_put - Stores a file on the FTP server (non-blocking)

SYNOPSIS
int ftp_nb_put (resource $ftp_stream, string $remote_file, string $local_file, int $mode, [int $startpos]) DESCRIPTION
ftp_nb_put(3) stores a local file on the FTP server. The difference between this function and the ftp_put(3) is that this function uploads the file asynchronously, so your program can perform other operations while the file is being uploaded. PARAMETERS
o $ftp_stream - The link identifier of the FTP connection. o $remote_file - The remote file path. o $local_file - The local file path. o $mode - The transfer mode. Must be either FTP_ASCII or FTP_BINARY. o $startpos -The position in the remote file to start uploading to. RETURN VALUES
Returns FTP_FAILED or FTP_FINISHED or FTP_MOREDATA. EXAMPLES
Example #1 ftp_nb_put(3) example <?php // Initiate the Upload $ret = ftp_nb_put($my_connection, "test.remote", "test.local", FTP_BINARY); while ($ret == FTP_MOREDATA) { // Do whatever you want echo "."; // Continue uploading... $ret = ftp_nb_continue($my_connection); } if ($ret != FTP_FINISHED) { echo "There was an error uploading the file..."; exit(1); } ?> Example #2 Resuming an upload with ftp_nb_put(3) <?php // Initiate $ret = ftp_nb_put($my_connection, "test.remote", "test.local", FTP_BINARY, ftp_size("test.remote")); // OR: $ret = ftp_nb_put($my_connection, "test.remote", "test.local", // FTP_BINARY, FTP_AUTORESUME); while ($ret == FTP_MOREDATA) { // Do whatever you want echo "."; // Continue uploading... $ret = ftp_nb_continue($my_connection); } if ($ret != FTP_FINISHED) { echo "There was an error uploading the file..."; exit(1); } ?> SEE ALSO
ftp_nb_fput(3), ftp_nb_continue(3), ftp_put(3), ftp_fput(3). PHP Documentation Group FTP_NB_PUT(3)
All times are GMT -4. The time now is 01:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy