I am running a bash script with sudo and have tried the below but am getting the error below using aws cp. I think the problem is that the script is looking for the config in /root which does not exist. However doesn't the -E preserve the original location? Is there an option that can be used with aws cp to pass the location of the config. Thank you :).
sudo -E bash /path/to/.sh
- inside of this script is `aws cp`
Error
The config profile (name) could not be found
I have also tried `export` the name profile and `source` the path to the `config`
aws. If I do not usesudotheaws cpis fine and returns no errors.... the problem is I needsudoto create the new directories. The originalconfigfile in$HOME/user/aws. Thank you :).export HOME=/rootand copy$HOME/user/.awsto/root/.aws, so there are two directories with credentials. I don't think this will cause issues? Thank you :).