> but chaos typically ensued if you attempted to rewrite the file you were presently running, as it appears that cmd didn't do anything fancy like read the whole file into memory before processing it
Neither does bash! That’s why you should always wrap things in a function and have the entry point of the script be the end of the file.
Neither does bash! That’s why you should always wrap things in a function and have the entry point of the script be the end of the file.