On Fri, Feb 11, 2022 at 10:24:46PM +0100, Alex fxmbsw7 Ratchev wrote:
> >> http://mywiki.wooledge.org/BashFAQ/028
> >>
> >
> > err from the page
> >
>
> greg, consider overhaulting your whole page, or it gets marked as invalid
> as the others by me
It's a wiki. It's publically writable. Most of the pages on the wiki
have multiple contributors.
> > bash stup ; cat stup
> > stup: line 1: cd: stup/: Not a directory
> > /root
> > cd "${BASH_SOURCE%/*}/"
> > pwd
Haven't we already covered this? You're using BASH_SOURCE and assuming
what will be in it conforms to a certain pattern. And then you're calling
the script with "bash stup" which means the content of BASH_SOURCE does
*not* match the pattern you expected it to match. It contains "stup"
rather than "./stup".
Fix your own bugs.