someone made a blog post claiming that bash scripts which do things like

stuff happens
cd $mydir

is "a waste of time" because scripts run in their own shells.

this is not true if you are *sourcing* the script:

$ sh
$ chmod +x; ./

behave as the blog post claims.

. ./

will leave you where the cd commands put you. the blog post completely ignores this fact; you should not.

· · Web · 0 · 0 · 4
Sign in to participate in the conversation
Mastodon @ SDF

"I appreciate SDF but it's a general-purpose server and the name doesn't make it obvious that it's about art." - Eugen Rochko