shell: use backticks for compability with Solaris /bin/sh

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
Yury V. Zaytsev 2024-11-02 12:05:34 +01:00 committed by Andrew Borodin
parent 6f60924c83
commit 81a7a5bc92
4 changed files with 15 additions and 15 deletions

View File

@ -32,7 +32,7 @@
#*** file scope functions ********************************************** #*** file scope functions **********************************************
XORRISO=$(command -v xorriso 2>/dev/null) XORRISO=`command -v xorriso 2>/dev/null`
# This snippet is used to undo xorriso's Text_shellsafe(). Pseudocode for the # This snippet is used to undo xorriso's Text_shellsafe(). Pseudocode for the
# function: # function:
@ -49,7 +49,7 @@ XORRISO=$(command -v xorriso 2>/dev/null)
# - iso_tree.c:Xorriso_ls() # - iso_tree.c:Xorriso_ls()
# - text_io.c:Xorriso_esc_filepath() # - text_io.c:Xorriso_esc_filepath()
# - misc_funct.c:Text_shellsafe() # - misc_funct.c:Text_shellsafe()
awk_xorriso_unesc=$(cat <<'EOF' awk_xorriso_unesc=`cat <<'EOF'
{ {
# Start of the path part # Start of the path part
i = index($0, "'") i = index($0, "'")
@ -78,14 +78,14 @@ awk_xorriso_unesc=$(cat <<'EOF'
print substr($0, 1, i-1) s print substr($0, 1, i-1) s
} }
EOF EOF
) `
xorriso_list() ( xorriso_list() (
if test -z "$XORRISO"; then if test -z "$XORRISO"; then
return 1 return 1
fi fi
temp_ls=$(mktemp "${MC_TMPDIR:-/tmp}"/mc-iso9660.XXXXXX) || return 1 temp_ls=`mktemp "${MC_TMPDIR:-/tmp}"/mc-iso9660.XXXXXX` || return 1
# $XORRISO must be unquoted here to hook into the testing framework # $XORRISO must be unquoted here to hook into the testing framework
$XORRISO -abort_on FATAL -dev stdio:"$1" -find / -exec lsdl 2>/dev/null >"$temp_ls" $XORRISO -abort_on FATAL -dev stdio:"$1" -find / -exec lsdl 2>/dev/null >"$temp_ls"
@ -143,18 +143,18 @@ xorriso_rm() {
# tested to comply with isoinfo 2.0's output # tested to comply with isoinfo 2.0's output
test_iso () { test_iso () {
ISOINFO=$(command -v isoinfo 2>/dev/null) ISOINFO=`command -v isoinfo 2>/dev/null`
if test -z "$ISOINFO"; then if test -z "$ISOINFO"; then
echo "isoinfo not found" >&2 echo "isoinfo not found" >&2
return 1 return 1
fi fi
CHARSET=$(locale charmap 2>/dev/null) CHARSET=`locale charmap 2>/dev/null`
if test -z "$CHARSET"; then if test -z "$CHARSET"; then
CHARSET=$(locale 2>/dev/null | grep LC_CTYPE | sed -n -e 's/.*\.\(.*\)"$/\1/p') CHARSET=`locale 2>/dev/null | grep LC_CTYPE | sed -n -e 's/.*\.\(.*\)"$/\1/p'`
fi fi
if test -n "$CHARSET"; then if test -n "$CHARSET"; then
CHARSET=$(echo "$CHARSET" | tr '[A-Z]' '[a-z]' | sed -e 's/^iso-/iso/') CHARSET=`echo "$CHARSET" | tr '[A-Z]' '[a-z]' | sed -e 's/^iso-/iso/'`
$ISOINFO -j $CHARSET -i /dev/null 2>&1 | grep "Iconv not yet supported\|Unknown charset" >/dev/null && CHARSET= $ISOINFO -j $CHARSET -i /dev/null 2>&1 | grep "Iconv not yet supported\|Unknown charset" >/dev/null && CHARSET=
fi fi
if test -n "$CHARSET"; then if test -n "$CHARSET"; then
@ -163,13 +163,13 @@ test_iso () {
JOLIET_OPT="-J" JOLIET_OPT="-J"
fi fi
ISOINFO_D_I="$($ISOINFO -d -i "$1" 2>/dev/null)" ISOINFO_D_I=`$ISOINFO -d -i "$1" 2>/dev/null`
ISOINFO="$ISOINFO -R" ISOINFO="$ISOINFO -R"
echo "$ISOINFO_D_I" | grep "UCS level 1\|NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT" echo "$ISOINFO_D_I" | grep "UCS level 1\|NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT"
if [ $(echo "$ISOINFO_D_I" | grep "Joliet with UCS level 3 found" | wc -l) = 1 \ if [ `echo "$ISOINFO_D_I" | grep "Joliet with UCS level 3 found" | wc -l` = 1 \
-a $(echo "$ISOINFO_D_I" | grep "NO Rock Ridge" | wc -l) = 1 ] ; then -a `echo "$ISOINFO_D_I" | grep "NO Rock Ridge" | wc -l` = 1 ] ; then
SEMICOLON="YES" SEMICOLON="YES"
fi fi
} }
@ -190,7 +190,7 @@ mcisofs_list () (
*) MYCAT="cat";; *) MYCAT="cat";;
esac esac
lsl=$($ISOINFO -l -i "$1" 2>/dev/null) lsl=`$ISOINFO -l -i "$1" 2>/dev/null`
r=$? r=$?
test $r -gt 0 && return $r test $r -gt 0 && return $r

View File

@ -16,7 +16,7 @@ ARJ="arj -+ -ja1"
mcarjfs_list () mcarjfs_list ()
{ {
$ARJ v "$1" | @AWK@ -v uuid=$(id -ru) ' $ARJ v "$1" | @AWK@ -v uuid=`id -ru` '
{ {
if (($0 ~ /^[0-9]+\) .*/)||($0 ~ /^------------ ---------- ---------- -----/)){ if (($0 ~ /^[0-9]+\) .*/)||($0 ~ /^------------ ---------- ---------- -----/)){
if (filestr ~ /^[0-9]+\) .*/) { if (filestr ~ /^[0-9]+\) .*/) {

View File

@ -10,7 +10,7 @@ HA=ha
mchafs_list () mchafs_list ()
{ {
$HA lf "$1" 2>/dev/null | @AWK@ -v uid=$(id -ru) ' $HA lf "$1" 2>/dev/null | @AWK@ -v uid=`id -ru` '
/^===========/ {next} /^===========/ {next}
{ {
if ($5="%" && $8~/DIR|ASC|HSC|CPY/) { if ($5="%" && $8~/DIR|ASC|HSC|CPY/) {

View File

@ -23,7 +23,7 @@ mklink ()
mczoofs_list () mczoofs_list ()
{ {
mklink "$1" mklink "$1"
$ZOO lq "$ARCHIVE" | @AWK@ -v uid=$(id -ru) ' $ZOO lq "$ARCHIVE" | @AWK@ -v uid=`id -ru` '
/^[^\ ]/ { next } /^[^\ ]/ { next }
{ {
if (NF < 8) if (NF < 8)