From: Antonio Ospite Date: Tue, 6 Oct 2015 10:26:17 +0000 (+0200) Subject: setenv: check in a more robust way that the script is being sourced X-Git-Url: https://git.ao2.it/android/android-app-development-getting-started.git/commitdiff_plain/b1642210516b6aeb2762d6811506f4fb6d66c24c?hp=b1642210516b6aeb2762d6811506f4fb6d66c24c setenv: check in a more robust way that the script is being sourced Sometimes a leading '-' shows up in $0 for login shells, for example this happens when opening a shell with "sudo -i"; in these cases $0 will look like "-bash" instead of "bash", and the comparison with $(basename $SHELL) fails even if the script is being sourced. Fix this by stripping the leading '-'. ---