how to pass variables to s3cmd in a script file

Hi All,

How to pass the variable to s3cmd put command? I'm trying to use this command in a script as below:

s3cmd put ${upload_path} s3://${upload_dest}

where

With the above command in script, the file is not getting uploaded.
Please help!!!

You might need test.file on the end of the upload destination there.

Does it print any error messages?

if I try the command outside of the script as below, it is working fine:

s3cmd put /home/eng/test.file s3://mybucket/ 

Show your entire script. Maybe your variables aren't being set correctly.

Here you go!!

        echo "Selected the option to Upload file"
        echo " "
        echo "Provide the complete path of the filename to upload to s3"
        read upload_path
        echo " "
        echo "List of Buckets:"
        s3cmd ls
        echo " "
        echo "Provide the destination bucket details to upload: "
        read upload_dest
        echo " "
        echo "source path : ${upload_path}"
        echo "dest path: ${upload_dest}"
        s3cmd put ${upload_path} s3://${upload_dest}