Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The lcd command changes the directory of the local system which, in this case, is the IBM i5/OS system. The cd command changes the directory on the remote or Linux system. Without the prompt command, before each file is transferred, you are prompted whether to transfer that file. 7.4 Running FTP commands in batch mode So far we have shown the FTP commands running interactively. While this is the common usage, it is possible to execute FTP commands in a batch or program mode. Inside a control language (CL) program in IBM i5/OS or a script file on the Linux system, you can enter the FTP commands, provide or be prompted for a user and password, and then run a number of FTP commands. You can use the FTP command rcmd to run a remote command. Example 7-2 is a simple script file that connects as user ITSOUSER, prompts for the password, creates an IBM i5/OS library, creates a number of source physical files, puts a number of source files, creates one of the CL programs that was just downloaded, and runs the newly created program. Example 7-2 Sample FTP script file: download.txt itsouser quote rcmd crtlib sysmgmt text('Systems Management Tools') quote rcmd crtsrcpf sysmgmt/qclsrc text('CL Programs') put ~itso/sysmgmt/chgcmddft.cl sysmgmt/qclsrc.chgcmddft