On 5/18/24 11:17 AM, Phi Debian wrote:
an enforcement that no alias source='source -i' could ever be possible.
This seems ridiculous. There should never be a prohibition against a user doing something that is not dangerous.
All this is because one writing a 'main' script (#!/bin/bash), sourcing a package of mine through my package management system, expecting the current source behavior, and later add the loading of a 'libraries' from a friend (terminal color jazz) that in turn start to mess around with alias source='source -i' and BASH_SOURCE_PATH cold start to break my way of finding my packages.
If you're worried about this, unalias source after loading this friend's `library'. You're already changing your environment to include it.
An alternative to this would be BASH_SOURCE_PATH="" don't do nothing with 'source', and allow the 'libraries' designer to do typeset -r BASH_SOURCE_PATH=""
No. If you want to make sure it's unset, force it to remain unset, and prevent anyone from setting it, unset BASH_SOURCE_PATH readonly BASH_SOURCE_PATH will do the job. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature