[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: small problem with BASH_SOURCE and PATH
From: |
Greg Wooledge |
Subject: |
Re: small problem with BASH_SOURCE and PATH |
Date: |
Fri, 11 Feb 2022 17:01:18 -0500 |
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.
- Re: small problem with BASH_SOURCE and PATH, (continued)
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Greg Wooledge, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Dennis Williamson, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH,
Greg Wooledge <=
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Greg Wooledge, 2022/02/11
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/12
- Re: small problem with BASH_SOURCE and PATH, Greg Wooledge, 2022/02/12
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/12
- Re: small problem with BASH_SOURCE and PATH, Alex fxmbsw7 Ratchev, 2022/02/12