G
Gilberto Gilberto
Hello All,
I am starting to experiment with Ruby for Sys Admin tasks. Now, I have
been working with Shell scripting for a few years now. Currently, I am
trying to figure out how I can create a "for loop" in Ruby.
In bash, I have the following: (the following is what I would like to
translate in Ruby but can't seem to figure this out)
BASH - here, I am trying to copy a few files to the same server in one
shot
for groups in "Account File" \
"Bank File" \
"Study Case" \
"Overall Status" ;
do
scp $groups user@server1:/tmp
done
For Ruby, I tried -
for group in Account File",
"Bank File",
"Study Case",
"Overall Status"
do
(scp groups user@server1:/tmp)
end
Of course, I get syntax errors everywhere. I am not sure how to use a
for loop in this case. Any input?
Thanks,
G
I am starting to experiment with Ruby for Sys Admin tasks. Now, I have
been working with Shell scripting for a few years now. Currently, I am
trying to figure out how I can create a "for loop" in Ruby.
In bash, I have the following: (the following is what I would like to
translate in Ruby but can't seem to figure this out)
BASH - here, I am trying to copy a few files to the same server in one
shot
for groups in "Account File" \
"Bank File" \
"Study Case" \
"Overall Status" ;
do
scp $groups user@server1:/tmp
done
For Ruby, I tried -
for group in Account File",
"Bank File",
"Study Case",
"Overall Status"
do
(scp groups user@server1:/tmp)
end
Of course, I get syntax errors everywhere. I am not sure how to use a
for loop in this case. Any input?
Thanks,
G