dylanaraps / pure-sh-bible

📖 A collection of pure POSIX sh alternatives to external processes.
MIT License
6.45k stars 281 forks source link

Change some trimming functions to subshells #31

Open augustobmoura opened 3 years ago

augustobmoura commented 3 years ago

We can have the situation that shell options are already unset, in that case we actually change them to setted. The correct way of preventing shell options overriding is using a subshell, because all the functions that use set are only printing the result the subshell works like a charm.

Also we can remove the resetting of options and env vars at the end of the functions

augustobmoura commented 3 years ago

Kinda solves https://github.com/dylanaraps/pure-sh-bible/pull/7 too