help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: small problem with BASH_SOURCE and PATH


From: Alex fxmbsw7 Ratchev
Subject: Re: small problem with BASH_SOURCE and PATH
Date: Fri, 11 Feb 2022 23:10:42 +0100

On Fri, Feb 11, 2022 at 11:10 PM Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
wrote:

>
>
> On Fri, Feb 11, 2022 at 11:02 PM Greg Wooledge <greg@wooledge.org> wrote:
>
>> 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.
>>
> i may edit it if i knew how
i didnt really look as u see

>
>> > > 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".
>>
> yea its from your page tho, u didnt cover the noslashinside case
>
>
>> Fix your own bugs.
>>
> :/
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]