On 3/18/21 3:09 AM, Vojtěch Zeisek wrote:
$ shellcheck -o all ~/.bashrc
In /home/vojta/.bashrc line 20: test -s ~/.alias && . ~/.alias || true ^-- SC2015: Note that A && B || C is not if-then-else. C may run when A is true. ^------^ SC1090: Can't follow non-constant source. Use a directive to specify location.
I believe you want test -s /home/vojta/.alias && . /home/vojta/.alias || true The problem is with '~' expansion in a .bashrc which can have unwanted consequences if the account or a script is accessed vi su or sudo and you don't specifically have --norc set to prevent invoking the bashrc as the other user. You have the same problem if you use $HOME instead of the absolute path for the user's home. See if that helps with shellcheck. -- David C. Rankin, J.D.,P.E.