bad gmail app buggs sorry , missed ending }
[[ $BASH_SOURCE == /* ]] &&
medir=${BASH_SOURCE%/*} || {
[[ $BASH_SOURCE != */* ]] &&
medir=$PWD ||
medir=$PWD/${BASH_SOURCE%/*}
}
On Thu, May 16, 2024, 15:48 alex xmb sw ratchev <[email protected]> wrote:
> maybe this one
>
> [[ $BASH_SOURCE == /* ]] &&
> medir=${BASH_SOURCE%/*} || {
> [[ $BASH_SOURCE != */* ]] &&
> medir=$PWD ||
> medir=$PWD/${BASH_SOURCE%/*}
> }
>
> On Thu, May 16, 2024, 15:45 alex xmb sw ratchev <[email protected]> wrote:
>
>>
>>
>> On Thu, May 16, 2024, 15:43 alex xmb sw ratchev <[email protected]>
>> wrote:
>>
>>>
>>>
>>> On Thu, May 16, 2024, 14:37 Oğuz <[email protected]> wrote:
>>>
>>>> On Wednesday, May 15, 2024, Chet Ramey <[email protected]> wrote:
>>>>
>>>> > is it more common to have
>>>> > something like the script in somewhere/bin, files to be sourced in
>>>> > somewhere/lib, and so on?
>>>>
>>>>
>>>> Not sure how common but this is what makes sense. Or name sourceables
>>>> foo.sh, bar.sh and executables foo, bar so they don't clash and source
>>>> with
>>>> `${BASH_SOURCE%/*}' prepended to PATH and it'll work fine.
>>>>
>>>
>>> [[ $BASH_SOURCE == /* ]] &&
>>> medir=${BASH_SOURCE%/*} ||
>>> medir=$PWD/${BASH_SOURCE%/*}
>>>
>>> declare -p medir
>>>
>>
>> sorry there is bug ..
>>
>>
>>> This feature request sounded promising at first, it feels like
>>>> bike-shedding now.
>>>>
>>>>
>>>> --
>>>> Oğuz
>>>>
>>>