Commit 07c02f67 authored by Jakub Jirutka's avatar Jakub Jirutka

replace deprecated `...` syntax with $(...) in shell scripts

parent cb474e20
......@@ -723,8 +723,8 @@ cmd_migrate_include_exclude() {
#-----------------------------------------------------------
# Main
cmd=`echo "$PROGRAM" | cut -s -d_ -f2`
PROGRAM=`echo "$PROGRAM" | cut -d_ -f1`
cmd=$(echo "$PROGRAM" | cut -s -d_ -f2)
PROGRAM=$(echo "$PROGRAM" | cut -d_ -f1)
if [ -z "$cmd" ] ; then
cmd="$1"
[ -z "$cmd" ] && usage
......@@ -773,7 +773,7 @@ while getopts "adehlM:np:qrv" opt ; do
;;
esac
done
shift `expr $OPTIND - 1`
shift $(expr $OPTIND - 1)
trap exit_clean SIGINT SIGTERM
cmd_$SUBCMD "$@"
......
......@@ -2,7 +2,7 @@
PREFIX=@PREFIX@
PROGRAM=`basename $0`
PROGRAM=$(basename $0)
: ${ROOT:=/}
[ "${ROOT}" = "${ROOT%/}" ] && ROOT="${ROOT}/"
......@@ -12,7 +12,7 @@ echon () {
if [ X"$ECHON" = X ]; then
# Determine how to "echo" without newline: "echo -n"
# or "echo ...\c"
if [ X`echo -n` = X-n ]; then
if [ X$(echo -n) = X-n ]; then
ECHON=echo
NNL="\c"
# "
......@@ -46,8 +46,8 @@ die() {
}
init_tmpdir() {
local omask=`umask`
local __tmpd="/tmp/$PROGRAM-${$}-`date +%s`-$RANDOM"
local omask=$(umask)
local __tmpd="/tmp/$PROGRAM-${$}-$(date +%s)-$RANDOM"
umask 077 || die "umask"
mkdir -p "$__tmpd" || exit 1
trap "rm -fr \"$__tmpd\"; exit" 0
......
......@@ -23,7 +23,7 @@ while getopts "ae:hl:n" opt ; do
*) usage;;
esac
done
shift `expr $OPTIND - 1`
shift $(expr $OPTIND - 1)
while [ $# -gt 0 ]; do
pkgs="$pkgs acf-$1"
......
......@@ -46,7 +46,7 @@ while getopts "af:c:hq" opt ; do
*) usage;;
esac
done
shift `expr $OPTIND - 1`
shift $(expr $OPTIND - 1)
rc_sys=$(openrc --sys)
# mount xenfs so we can detect xen dom0
......
......@@ -176,12 +176,12 @@ fi
MIRRORS_PATH=/usr/share/alpine-mirrors/MIRRORS.txt
if [ -z "$MIRRORS" ] && [ -r "$MIRRORS_PATH" ]; then
MIRRORS=`cat $MIRRORS_PATH`
MIRRORS=$(cat $MIRRORS_PATH)
fi
APKREPOS_PATH="${ROOT}"etc/apk/repositories
if [ -r "$APKREPOS_PATH" ]; then
APKREPOS=`cat "$APKREPOS_PATH"`
APKREPOS=$(cat "$APKREPOS_PATH")
fi
get_alpine_release
......
......@@ -215,7 +215,7 @@ fi
srcdir=
# Find the srcdir or srcurl. mount loopback if needed
if [ -f "$src"/.alpine-release ]; then
srcdir="`echo $src | sed -r 's,/$,,'`"
srcdir="$(echo $src | sed -r 's,/$,,')"
else
case "$src" in
http://*|ftp://*) srcurl="$src";;
......
......@@ -31,8 +31,8 @@ shift $(($OPTIND - 1))
conf="${ROOT}etc/resolv.conf"
if [ -f "$conf" ] ; then
domain=`awk '/^domain/ {print $2}' $conf`
dns=`awk '/^nameserver/ {print $2}' $conf`
domain=$(awk '/^domain/ {print $2}' $conf)
dns=$(awk '/^nameserver/ {print $2}' $conf)
fi
if [ -n "$DOMAINNAME" ];then
......
......@@ -57,7 +57,7 @@ fi
HOST="$name"
while [ -z "$name" ]; do
HOST=`hostname`
HOST=$(hostname)
echon "Enter system hostname (short form, e.g. 'foo') [$HOST]: "
default_read HOST "$HOST"
if valid_hostname "$HOST"; then
......
......@@ -190,7 +190,7 @@ config_iface() {
done
if [ "$resp" = "yes" ]; then
bridge="br"`echo $iface | sed 's/[^0-9]//g'`
bridge="br$(echo $iface | sed 's/[^0-9]//g')"
ask "Name of the bridge you want add $iface to:" $bridge
bridge_add_port $resp $iface
return
......@@ -261,7 +261,7 @@ config_iface() {
# use ipcalc -m to validate netmask. we dont accept <addr>/mask suffix
# so we pass on a dummy mask to ipcalc.
while ! ipcalc -s -m $netmask/0 >/dev/null 2>&1; do
netmask=`get_default_mask $address`
netmask=$(get_default_mask $address)
ask "Netmask?" $netmask
netmask=$resp
[ "$netmask" = "abort" ] && return
......@@ -270,7 +270,7 @@ config_iface() {
# use ipcalc -m to validate netmask. we dont accept <addr>/mask suffix
# so we pass on a dummy mask to ipcalc.
while ! ipcalc -s -m $gateway/0 >/dev/null 2>&1; do
gateway=`get_default_gateway $iface`
gateway=$(get_default_gateway $iface)
[ -z "$gateway" ] && gateway=none
ask "Gateway? (or 'none')" $gateway
gateway=$resp
......@@ -480,7 +480,7 @@ prompt_for_interfaces() {
hostname=$(cat $ROOT/etc/hostname 2>/dev/null)
for i in *.conf ; do
iface=`basename $i .conf`
iface=$(basename $i .conf)
iface=${iface#[0-9]*~}
bridge_ports=
bond_slaves=
......
......@@ -26,7 +26,7 @@ __EOF__
is_modified() {
[ -f "$LBUCACHE" ] || lbu status -a | awk '{print $2}' > "$LBUCACHE"
test -n "`( echo \"$1\" ; cat \"$LBUCACHE\" ) | sort | uniq -d`"
test -n "$( ( echo \"$1\" ; cat \"$LBUCACHE\" ) | sort | uniq -d)"
}
......@@ -34,7 +34,7 @@ is_initd() {
echo "$1" | grep etc/init.d/ > /dev/null
}
args=`getopt -o ailh --long all,initd,list,help -n "$PROGRAM" -- "$@"`
args=$(getopt -o ailh --long all,initd,list,help -n "$PROGRAM" -- "$@")
if [ $? -ne 0 ]; then
usage
exit 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment