mirror of
https://github.com/gwebu-team/profile.d.git
synced 2025-12-11 13:15:45 +00:00
Detect if the scripts are not sourced and print help.
This commit is contained in:
parent
5b8a75b75c
commit
dc0be5c2a1
4 changed files with 20 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
if [ "${BASH_SOURCE-}" = "$0" ]; then
|
||||||
|
echo -e "You must source this script:\n\tsource $0" >&2
|
||||||
|
exit 33
|
||||||
|
fi
|
||||||
|
|
||||||
# show hidden files and directories
|
# show hidden files and directories
|
||||||
alias l.='ls -d .[^.]* ..?* --color=tty 2>/dev/null'
|
alias l.='ls -d .[^.]* ..?* --color=tty 2>/dev/null'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
if [ "${BASH_SOURCE-}" = "$0" ]; then
|
||||||
|
echo -e "You must source this script:\n\tsource $0" >&2
|
||||||
|
exit 33
|
||||||
|
fi
|
||||||
|
|
||||||
EDITOR=mcedit
|
EDITOR=mcedit
|
||||||
export EDITOR
|
export EDITOR
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,11 @@
|
||||||
# - http://www.onerussian.com/Linux/bash_history.phtml
|
# - http://www.onerussian.com/Linux/bash_history.phtml
|
||||||
# - https://debian-administration.org/article/175/BASH_history_forever.
|
# - https://debian-administration.org/article/175/BASH_history_forever.
|
||||||
|
|
||||||
|
if [ "${BASH_SOURCE-}" = "$0" ]; then
|
||||||
|
echo -e "You must source this script:\n\tsource $0" >&2
|
||||||
|
exit 33
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$PS1" ] ; then # interactive shell detection
|
if [ "$PS1" ] ; then # interactive shell detection
|
||||||
|
|
||||||
# Log the logout event.
|
# Log the logout event.
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,7 @@
|
||||||
|
if [ "${BASH_SOURCE-}" = "$0" ]; then
|
||||||
|
echo -e "You must source this script:\n\tsource $0" >&2
|
||||||
|
exit 33
|
||||||
|
fi
|
||||||
|
|
||||||
TIME_STYLE=long-iso
|
TIME_STYLE=long-iso
|
||||||
export TIME_STYLE
|
export TIME_STYLE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue