aboutsummaryrefslogtreecommitdiff
path: root/straper/db/public/environment/profile.d
diff options
context:
space:
mode:
Diffstat (limited to 'straper/db/public/environment/profile.d')
-rw-r--r--straper/db/public/environment/profile.d/70-systemd-shell-extra.sh25
-rw-r--r--straper/db/public/environment/profile.d/bash_completion.sh16
-rw-r--r--straper/db/public/environment/profile.d/gawk.csh11
-rw-r--r--straper/db/public/environment/profile.d/gawk.sh31
4 files changed, 83 insertions, 0 deletions
diff --git a/straper/db/public/environment/profile.d/70-systemd-shell-extra.sh b/straper/db/public/environment/profile.d/70-systemd-shell-extra.sh
new file mode 100644
index 0000000..dae77e4
--- /dev/null
+++ b/straper/db/public/environment/profile.d/70-systemd-shell-extra.sh
@@ -0,0 +1,25 @@
+# shellcheck shell=sh
+
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+# Import the additional shell prompt prefix and suffix strings into $PS1, and
+# show the shell welcome string. These can be provisioned as system or service
+# credentials shell.prompt.prefix, shell.prompt.suffix and shell.welcome, and
+# are propagated into these environment variables by pam_systemd(8).
+
+if [ -n "${SHELL_PROMPT_PREFIX-}" ]; then
+ PS1="$SHELL_PROMPT_PREFIX$PS1"
+fi
+
+if [ -n "${SHELL_PROMPT_SUFFIX-}" ]; then
+ PS1="$PS1$SHELL_PROMPT_SUFFIX"
+fi
+
+if [ -n "${SHELL_WELCOME-}" ]; then
+ printf '%b\n' "$SHELL_WELCOME"
+fi
diff --git a/straper/db/public/environment/profile.d/bash_completion.sh b/straper/db/public/environment/profile.d/bash_completion.sh
new file mode 100644
index 0000000..8c031cf
--- /dev/null
+++ b/straper/db/public/environment/profile.d/bash_completion.sh
@@ -0,0 +1,16 @@
+# shellcheck shell=sh disable=SC1091,SC2166,SC2268,SC3028,SC3044,SC3054
+# Check for interactive bash and that we haven't already been sourced.
+if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then
+
+ # Check for recent enough version of bash.
+ if [ "${BASH_VERSINFO[0]}" -gt 4 ] ||
+ [ "${BASH_VERSINFO[0]}" -eq 4 -a "${BASH_VERSINFO[1]}" -ge 2 ]; then
+ [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] &&
+ . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
+ if shopt -q progcomp && [ -r /usr/share/bash-completion/bash_completion ]; then
+ # Source completion code.
+ . /usr/share/bash-completion/bash_completion
+ fi
+ fi
+
+fi
diff --git a/straper/db/public/environment/profile.d/gawk.csh b/straper/db/public/environment/profile.d/gawk.csh
new file mode 100644
index 0000000..583d5bc
--- /dev/null
+++ b/straper/db/public/environment/profile.d/gawk.csh
@@ -0,0 +1,11 @@
+alias gawkpath_default 'unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`'
+
+alias gawkpath_prepend 'if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH == "") then; unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKPATH "\!*"":$AWKPATH"'
+
+alias gawkpath_append 'if (! $?AWKPATH) setenv AWKPATH ""; if ($AWKPATH == "") then; unsetenv AWKPATH; setenv AWKPATH `gawk -v x=AWKPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKPATH "$AWKPATH"":\!*"'
+
+alias gawklibpath_default 'unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`'
+
+alias gawklibpath_prepend 'if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH == "") then; unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKLIBPATH "\!*"":$AWKLIBPATH"'
+
+alias gawklibpath_append 'if (! $?AWKLIBPATH) setenv AWKLIBPATH ""; if ($AWKLIBPATH == "") then; unsetenv AWKLIBPATH; setenv AWKLIBPATH `gawk -v x=AWKLIBPATH "BEGIN {print ENVIRON[x]}"`; endif; setenv AWKLIBPATH "$AWKLIBPATH"":\!*"'
diff --git a/straper/db/public/environment/profile.d/gawk.sh b/straper/db/public/environment/profile.d/gawk.sh
new file mode 100644
index 0000000..c35471f
--- /dev/null
+++ b/straper/db/public/environment/profile.d/gawk.sh
@@ -0,0 +1,31 @@
+gawkpath_default () {
+ unset AWKPATH
+ export AWKPATH=`gawk 'BEGIN {print ENVIRON["AWKPATH"]}'`
+}
+
+gawkpath_prepend () {
+ [ -z "$AWKPATH" ] && AWKPATH=`gawk 'BEGIN {print ENVIRON["AWKPATH"]}'`
+ export AWKPATH="$*:$AWKPATH"
+}
+
+gawkpath_append () {
+ [ -z "$AWKPATH" ] && AWKPATH=`gawk 'BEGIN {print ENVIRON["AWKPATH"]}'`
+ export AWKPATH="$AWKPATH:$*"
+}
+
+gawklibpath_default () {
+ unset AWKLIBPATH
+ export AWKLIBPATH=`gawk 'BEGIN {print ENVIRON["AWKLIBPATH"]}'`
+}
+
+gawklibpath_prepend () {
+ [ -z "$AWKLIBPATH" ] && \
+ AWKLIBPATH=`gawk 'BEGIN {print ENVIRON["AWKLIBPATH"]}'`
+ export AWKLIBPATH="$*:$AWKLIBPATH"
+}
+
+gawklibpath_append () {
+ [ -z "$AWKLIBPATH" ] && \
+ AWKLIBPATH=`gawk 'BEGIN {print ENVIRON["AWKLIBPATH"]}'`
+ export AWKLIBPATH="$AWKLIBPATH:$*"
+}