I have a file hosted on an s3 bucket that has the following format:
var1=value1
var2=value2
var3=value3
I wish to create a bash script on my Linux box that when executed, set environment variables from the remote file. SO far, I have tried the following:
#!/bin/sh
export $(aws s3 cp s3://secret-bucket/file.txt - | sed -e /^$/d -e /^#/d | xargs)
#!/bin/sh
eval $(aws s3 cp s3://secret-bucket/file.txt - | sed 's/^/export /')
But none of them seems to work because when I execute printenv
the variables I need do not show. Any help would be very much appreciated.