Hi, On 2024-04-17 13:55:31 +0200, Santiago Vila wrote: > The problem, more than lack of quoting, is that there is no specification > anywhere about what should be allowed and what should not. > > But we are not late to begin such specification. > Here is my current plan: > > --- a/share/profile > +++ b/share/profile > @@ -25,7 +25,7 @@ if [ "${PS1-}" ]; then > fi > if [ -d /etc/profile.d ]; then > - for i in /etc/profile.d/*.sh; do > + for i in $(run-parts --list --regex '^[a-zA-Z0-9._-]+.sh$' > /etc/profile.d); do > if [ -r $i ]; then > . $i > fi
This is wrong in multiple ways: * It would now include "hidden" files (i.e. with a name starting with a "."). And I think that filenames starting with "-" should also be ignored. * It would include the .csh files, such as "gawk.csh". So I think that the --regex argument should be '^[a-zA-Z0-9_][a-zA-Z0-9._-]*\.sh$' Regards, -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)