Bash: Why would sourcing a file be less safe than bashing it (executing in another session)?
Is it the case, or I completely misunderstood?
I've heard in the the context of sourcing a sub-script from a master-script. For example, you curl
and source
remote script which sources one or more script (for the sake of the question let's assume that all of these scripts are safe and okay).
What I try to understand is why would someone think it's less safe to source the internal script, rather then running it (~/sub-script.sh
or bash ~/sub-script.sh
).
If this entire question sounds unlikely or absurd please don't be sarcastic, but please do make sure to vote to close it if you can as it might just be based of a misunderstanding from my side, or a misphrasing of some deeper intention of the man that said that.