Changed dot-config to .config
This commit is contained in:
parent
9ea93f8144
commit
0ab0f24015
118 changed files with 29 additions and 980 deletions
30
misc/.local/bin/sysbin
Executable file
30
misc/.local/bin/sysbin
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env sh
|
||||
# Finds the absolute path of a system binary by checking places in most-likely order.
|
||||
# Helpful for when overriding a binary with a script, meaning the script takes higher
|
||||
# precedence in the path, but then the script needs to call the actual binary.
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
# No program prvided
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Split the custom path into an array based on ":" (path separator)
|
||||
IFS=":" read -ra path_dirs <<< "$PATH"
|
||||
|
||||
# Iterate through the directories in PATH_2
|
||||
for dir in "${path_dirs[@]}"; do
|
||||
if [ "$(echo "$dir" | cut -c 1)" = "~" ] || [ "$(echo "$dir" | cut -c 1-5)" = "/home" ]; then
|
||||
# We are looking in a user's home, skip.
|
||||
continue
|
||||
fi
|
||||
|
||||
potential_path="$dir/$1"
|
||||
if [ -x "$potential_path" ]; then
|
||||
"$dir/$@"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
echo "command not found: $1"
|
||||
exit 2 # Not found
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue