Arun Antony
Arun Antony

Reputation: 593

How to send multiple files through SFTP from KSH Unix script

How do I transfer multiple files through SFTP using KSH unix script.

I am having the following information regarding the legacy system.

echo "Current Directory : " $l_out_path 
echo "Data File(s)      : " $l_data_file
echo "Destination Path  : " $l_ftp_path
echo "FTP USER      : " $ftpuser

All help in this regards are highly appreciated.

Thanks, Arun

Upvotes: 1

Views: 2969

Answers (1)

Dennis Williamson
Dennis Williamson

Reputation: 360485

Something like this might be what you're looking for:

echo "put $l_out_path/$l_data_file" | sftp -b - -oUser="$ftpuser" "$l_ftp_path"

What exactly are you having difficulty with? What do the contents of those variables look like? Their names and descriptions provide some information, but perhaps not enough.

Upvotes: 1

Related Questions