From: Atropo on
On 28 jul, 18:03, "Chris F.A. Johnson" <cfajohn...(a)gmail.com> wrote:
> On 2010-07-28, Atropo wrote:
> > Hi all.
>
> > My intend was to copy several files on several serves on differents
> > dirs.
>
> > #!/bin/ksh
> > #File=$1
> > sPath=/sourcepath
> > #sPath=$2
> > #tPath=$3
>
> > for server in "1 2 3 4"
>
>    How many arguments is "1 2 3 4"?
>
>    How many arguments is 1 2 3 4?
>
>
>
> > do
> > echo Server $server
>
> > for File in "file1 file2 file3 "
> > do
> > while read tPath    #dirs where the files will be copy
> > do
> > echo scp $sPath/${File} ptuprd(a)app${server}:${tPath}/.
>
> > echo scp $sPath/${File} ptuprd(a)ig${server}:${tPath}/.
>
> > done<dirs
> > done
> > done
>
> > it shows
>
> > Server 1 2 3 4
> > scp /sourcepath/file1 file2 file3 ptuprd(a)app1 2 3 4 :/dir1/.
> > scp /sourcepath/file1 file2 file3 ptuprd(a)app1 2 3 4 :/dir2./.
> > scp /sourcepath/file1 file2 file3 ptuprd(a)app1 2 3 4 :/dir3/.
>
> > the script i've posted is edited, so it may have errors irrelevant to
> > my concern
>
> --
>    Chris F.A. Johnson, author           <http://shell.cfajohnson.com/>
>    ===================================================================
>    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
>    Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)

Ok. now i ge it. thanks