Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a shell script it gets the files from another server
C++
int main()
    {
     char y[18];
    // copying the value into y
    strcpy(y,"123456789.111"); 
    
    // calling the shell script
    system("/home/sandy/sftp2.sh y"); 
    return 0;
    
    } //end of main


Here i need to get all the files that starts 123456789.111 . I am new to this please help to resolve this.
Posted
Updated 1-Oct-15 0:21am
v3
Comments
chandanadhikari 1-Oct-15 6:13am    
what output do you get ... please elaborate more about what error message you are getting.

1 solution

Quote:
system("/home/sandy/sftp2.sh y");
The above line passes the letter 'y' as argument to the script while you probably want to pass the y variable value, namely the "123456789.111" string.

However, I wonder why don't you write directly
C
system("/home/sandy/sftp2.sh 123456789.111");

?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900