Basically, i am reading a file and transferring files between two servers using sftp. I am checking the last character of the file which gives me the server number to transfer the file to..After i check the server number and try to include the sftp code....it gives me am error
The biggest thing I see wrong with it is you haven't picked one language to do it in. Seems to be a mixture of C++, sh, and/or others.
Care to enlighten me on what language it is?
Post your OS and version too.
As far as these lines go, they should work as long as /home/ravala/test already exist (tested by themselves in ksh on Solaris 2.6).
So tell me, what is a comment in bash? I thought it was #.
You have the following...
// code for getting $strlen1
Isnt' that a comment in C++? I get an error if I add it to the script.
And you have
declare -a input
declare -a fileinput
(edited - as you can tell, I've never used bash - I thought the declare statements were also a C or C++ thing. My apologies).
How are you starting this (since you don't include the #!/path/bash in the start of the script)?
Try commenting out the sftp lines and put in a echo "I got to the sftp lines" - run your script - see if you still get the error because I don't know what you have in those other files that you are reading...so it makes it harder for me to quickly find what's wrong with the script. I've gotten into the second while but can't run your code.