bin/btop
2023-02-24 19:44:30 -06:00

25 lines
558 B
Bash
Executable File

#!/bin/sh
# distrobox_binary
# name: default
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
command="/bin/distrobox-enter -n default -- /bin/btop "
for arg in "$@"; do
if echo "${arg}" | grep -Eq "'|\""; then
command="${command} \
$(echo "${arg}" | sed 's|\\|\\\\|g' |
sed 's| |\\ |g' |
sed 's|\$|\\\$|g' |
sed "s|'|\\\'|g" |
sed 's|"|\\\"|g')"
elif echo "${arg}" | grep -q "'"; then
command="${command} \"${arg}\""
else
command="${command} '${arg}'"
fi
done
eval ${command}
else
/bin/btop "$@"
fi