call a script from another script passing parameters

I want to call script2 from script1 passing parameters. I want to read the parameters list in script1, check the local directory (for example - lpath1|lpath2|lpath3|lpath4|lpath5|) for the existance of files and set the` lcount` to the number of files in this folder (`
lpath1|lpath2|lpath3|lpath4|lpath5`)

  • if lcount > 0 , I want to call script2 with input parameters and then process the next line of the parameter list

Here is an example of a parameter list:
key1|IP1|user1|pass1|lpath1|lpath2|lpath3|lpath4|lpath5|lcount|rpath1|rpath2|rpath3|rpath4|rpath5|email1 |email2

key2|IP2|user2|pass2|lpath1|lpath2|lpath3|lpath4|lpath5|lcount|rpath1|rpath2|rpath3|rpath4|rpath5|email1 |email2

Key3|IP3|user3|pass3|lpath1|lpath2|lpath3|lpath4|lpath5|lcount|rpath1|rpath2|rpath3|rpath4|rpath5|email1 |email2

why you wanna call second script.. make that second script as function and call it where ever you want..

The second script will ftp all files from specific host folder to a client server (from the list). Also need to archive all transferred files, send a message (email) if any file was not transferred successfully and save (email) a ftp log after the script's execution.