mirror of
https://github.com/StackExchange/blackbox.git
synced 2025-12-15 19:13:01 +02:00
Rewrite profile.d-usrblackbox.sh to only use BASH built-ins; retain file size <132 so that it is an "inline" file.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
# To run the test:
|
||||
# bash tools/profile.d-usrblackbox-test.sh | fgrep --color /usr/blackbox/bin
|
||||
# sh profile.d-usrblackbox-test.sh | fgrep --color /usr/blackbox/bin
|
||||
# sh tools/profile.d-usrblackbox-test.sh | fgrep --color /usr/blackbox/bin
|
||||
|
||||
# NOTE: profile.d-usrblackbox.sh is written to be so small that it fits as an "inline" file.
|
||||
# https://lwn.net/Articles/468678/
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
x=/usr/blackbox/bin
|
||||
if type pathmunge>/dev/null 2>&1;then
|
||||
pathmunge $x
|
||||
elif ! grep -sqF :$x:<<<":$PATH:";then
|
||||
PATH="$x:$PATH"
|
||||
fi
|
||||
else case ":$PATH:" in *:$x:*);;*)PATH="$x:$PATH";;esac;fi
|
||||
Reference in New Issue
Block a user