Using curl
as in:
bash <(curl -s https://raw.githubusercontent.com/user/repo/master/script.sh | tr -d '\r')
I executed some remote script.
The remote script includes the following two aspects:
1) The command:
wget -P ~/myAddons/ https://raw.githubusercontent.com/user/repo/master/appendix.sh
2) a source ~/myAddons/appendix.sh
command:
This file appendix.sh
, includes some Bash aliases.
The problem
After executing the remote script, I tried to use some aliases from appendix.sh
. None worked.
Only after manually executing source ~/myAddons/appendix.sh
, the aliases worked.
- I checked at least 3 times that both the remote script's
source
command, and the manual command, are the same.
The question
Why did the execution of source ~/myAddons/appendix.sh
directly from the remote script, fail, while the manually it worked, and what's the right way to cope with that?
curl
? 2) I think you've missed a phase of running it, or else missed some explanation about it.bash <(...)
and then sourcing within it. That won't affect the original shell from which you ranbash <(...)
. – muru Jan 28 '18 at 05:08