Skip to content
Snippets Groups Projects

`command -v` portability

Merged Eli Schwartz requested to merge eschwartz/xdg-utils:command-v-portability into master
5 unresolved threads
+ 4
4
@@ -90,7 +90,7 @@ open_kde()
local kreadconfig=kreadconfig
fi
if which $kreadconfig >/dev/null 2>&1; then
if command -v $kreadconfig >/dev/null; then
local profile=$($kreadconfig --file emaildefaults \
--group Defaults --key Profile)
if [ -n "$profile" ]; then
@@ -98,7 +98,7 @@ open_kde()
--group "PROFILE_$profile" \
--key EmailClient \
| cut -d ' ' -f 1)
if [ -z "${client%%*.desktop}" ] && ! which "$client" >/dev/null 2>&1; then
if [ -z "${client%%*.desktop}" ] && ! command -v "$client" >/dev/null 2>&1; then
client=`desktop_file_to_binary "$client"`
fi
@@ -115,7 +115,7 @@ open_kde()
*) command=kde-open$KDE_SESSION_VERSION ;;
esac
if which $command >/dev/null 2>&1; then
if command -v $command >/dev/null; then
DEBUG 1 "Running $command \"$1\""
if [ "$KDE_SESSION_VERSION" = 3 ]; then
# KDE3 uses locale's encoding when decoding the URI,
@@ -435,7 +435,7 @@ mailto=`echo "${mailto}"| sed 's/[?&]$//'`
# Shouldn't happen
[ x"${mailto}" != x"" ] || exit_failure_syntax
if which @NAME@-hook.sh > /dev/null 2> /dev/null; then
if command -v @NAME@-hook.sh > /dev/null; then
@NAME@-hook.sh "${mailto}"
if [ $? -eq 0 ]; then
exit_success
Loading