Hello,
I have a problem with my script whereby it does not want to loop.
The function of my script is to FTP into a server and go to each directory/volume in the array 'VOL'. The way the loop is suppose to work, is to go into the first volume, get the files of R(yesterday's date) and save them in another server .. 'REPOSITORY' and then move on to the other volume in the array.
The problem with my script is that it does not loop. It just runs in the first directory then ends.
Below is the output after running my script.
CDR:/home # ./getama.sh
Connected to ##.##.##.##
220 Welcome to Bla Bla Bla
331 Password required.
230 User logged in, proceed
Remote system type is SOS.
200 Command okay.
Local directory now /home/CDR-backups
usage: for format
?Invalid command.
200 Directory changed.
257 Current working directory is "/D010AMAB"
500 Syntax error, command unrecognized.
227 Entering Passive Mode (##,##,##,##,11,186)
150 File status okay; about to open data connection.
DIRP_FILESEG FIXED 2048 ********
DIRP_FILESEG FIXED 2048 ********
DIRP_FILESEG FIXED 2048 ********
226 Request successful. Closing data connection.
?Invalid command.
221 Service closing control connection.
ftp is NOT a scripting language. You could create a string (script) using your loop logic from the shell and pass the resulting created script string as input to ftp.
Your version of ftp client might not like a large set of commands coming at it using the mechanism you are using though. Try it.
I'm sorry, I don't quite understand. This is the first time I'm writing a shell script and I've been following some tutorials. Are you saying that I can't run a For Loop while being in an ftp session?
Also ... I'm not familiar with string (script). I tried googling it but I can't come across anything useful. Can you direct me to tutorials? I would really appreciate it.
thanks.
Last edited by tuffgong2008; 12-19-2008 at 03:44 PM..
Reason: Adding more info
Hi, I have the following problem that is beyond what I can currently do with bash scripting.
In file 1, I have ~ 2500000 values. Note this file is not sorted.
3 19 LABEL_A
3 37 LABEL_B
2 12 LABEL_C
1 15 LABEL_D
I have a list of values in "file 2" ~ 25000 unique lines:
Note -... (6 Replies)
Hello All,
Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....?
I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping
through a string containing some of these "Illegal Characters". Now... (5 Replies)
Below is a test script I was trying to use so that I could understand why the logic was not working in a larger script. While accessing and printing array data inside the while loop, everything is fine. Outside the loop, i guess everything is null?? The for loop that is meant to cycle... (4 Replies)
Hi All,
I am trying to run a do while for an array. And in the do while, I'm trying to get a user response. Depending on the the answer, I go ahead and do something or I move on to next element in the array.
So far I can read the array, but I can't get the if statement to work. Any suggestions... (5 Replies)
I've got this problem, if I modify an array in the loop and print it, everything is fine as long as I stay in the loop. But, when I print it outside the loop, nothing happens... How can I solve this problem?
Here I prepared a sample for you to see my problem;
zgrw@Rain:~$ cat test
asd
123... (4 Replies)
Sorry for such a dreadful title, but I'm not sure how to be more descriptive. I'm hoping some of the more gurutastic out there can take a look at a solution I came up with to a problem, and advice if there are better ways to have gone about it.
To make a long story short around 20K pieces of... (2 Replies)
Hi Forum,
I am struggling with the for loop in shell script.
Let me explain what is needed in the script.
I have a file which will conatin some strings like
file1
place1
place2
place3
checkpoint
some other text
some more text
Now what my requirement is
the words ... (2 Replies)
My code isn't pretty, my verbage isn't exact and I probably don't have all my facts together (story of my life). I know what I want with this script: to join three simple lines line 1,2,3 then repeat over and over again with 4,5,6 until the end of the file. the lines are the same, date,date,text.... (3 Replies)