Create batch file which is executed in remote machine
Batch name : batch_file contents are
lcd .
$lv_pre_option
$lv_ftp_cmd ${lv_file_name}.${timestamp_val}.gpg
3.Execute the batch
sftp batch_file “remoteHostUser@remotHostName”
sudo command :
In Oracle Apps some of the special software(gpg encryption,decryption,sftp process) installed in specific user. So if you want to use those software we need to add software installed user as sudo user.
sudo -u “username” –H “barchName”
barchName – this batch is executed in other system. which holds some of the command to be executed in sudo user