Style only change: Prefer $() to ``

$() is more modern and also nests. Convert the mix of styles to using
only the former (although the latter was more common). It's the more
dominant style in other shell scripts these days as well.

Differential Revision:  https://reviews.freebsd.org/D19840
This commit is contained in:
Warner Losh 2019-04-08 18:25:14 +00:00
parent 7bead17ddc
commit 79beb71643
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=346039

View File

@ -120,12 +120,12 @@ b=share/examples/etc/bsd-style-copyright
for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
do do
if [ -r "$bsd_copyright" ]; then if [ -r "$bsd_copyright" ]; then
COPYRIGHT=`sed \ COPYRIGHT=$(sed \
-e "s/\[year\]/1992-$year/" \ -e "s/\[year\]/1992-$year/" \
-e 's/\[your name here\]\.* /The FreeBSD Project./' \ -e 's/\[your name here\]\.* /The FreeBSD Project./' \
-e 's/\[your name\]\.*/The FreeBSD Project./' \ -e 's/\[your name\]\.*/The FreeBSD Project./' \
-e '/\[id for your version control system, if any\]/d' \ -e '/\[id for your version control system, if any\]/d' \
$bsd_copyright` $bsd_copyright)
break break
fi fi
done done
@ -153,19 +153,19 @@ then
fi fi
touch version touch version
v=`cat version` v=$(cat version)
u=${USER:-root} u=${USER:-root}
d=`pwd` d=$(pwd)
h=${HOSTNAME:-`hostname`} h=${HOSTNAME:-$(hostname)}
if [ -n "$SOURCE_DATE_EPOCH" ]; then if [ -n "$SOURCE_DATE_EPOCH" ]; then
if ! t=`date -r $SOURCE_DATE_EPOCH 2>/dev/null`; then if ! t=$(date -r $SOURCE_DATE_EPOCH 2>/dev/null); then
echo "Invalid SOURCE_DATE_EPOCH" >&2 echo "Invalid SOURCE_DATE_EPOCH" >&2
exit 1 exit 1
fi fi
else else
t=`date` t=$(date)
fi fi
i=`${MAKE:-make} -V KERN_IDENT` i=$(${MAKE:-make} -V KERN_IDENT)
compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep -w 'version') compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep -w 'version')
for dir in /usr/bin /usr/local/bin; do for dir in /usr/bin /usr/local/bin; do
@ -212,7 +212,7 @@ if findvcs .hg; then
fi fi
if [ -n "$svnversion" ] ; then if [ -n "$svnversion" ] ; then
svn=`cd ${SYSDIR} && $svnversion 2>/dev/null` svn=$(cd ${SYSDIR} && $svnversion 2>/dev/null)
case "$svn" in case "$svn" in
[0-9]*[MSP]|*:*) [0-9]*[MSP]|*:*)
svn=" r${svn}" svn=" r${svn}"
@ -228,8 +228,8 @@ if [ -n "$svnversion" ] ; then
fi fi
if [ -n "$git_cmd" ] ; then if [ -n "$git_cmd" ] ; then
git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null)
gitsvn=`$git_cmd svn find-rev $git 2>/dev/null` gitsvn=$($git_cmd svn find-rev $git 2>/dev/null)
if [ -n "$gitsvn" ] ; then if [ -n "$gitsvn" ] ; then
svn=" r${gitsvn}" svn=" r${gitsvn}"
git="=${git}" git="=${git}"
@ -238,13 +238,13 @@ if [ -n "$git_cmd" ] ; then
# We assume that if a tree is more than 10k commits out-of-sync # We assume that if a tree is more than 10k commits out-of-sync
# with FreeBSD, it has forked the the OS and the SVN rev no # with FreeBSD, it has forked the the OS and the SVN rev no
# longer matters. # longer matters.
gitsvn=`$git_cmd log -n 10000 | gitsvn=$($git_cmd log -n 10000 |
grep '^ git-svn-id:' | head -1 | \ grep '^ git-svn-id:' | head -1 | \
sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p')
if [ -z "$gitsvn" ] ; then if [ -z "$gitsvn" ] ; then
gitsvn=`$git_cmd log -n 10000 --format='format:%N' | \ gitsvn=$($git_cmd log -n 10000 --format='format:%N' | \
grep '^svn ' | head -1 | \ grep '^svn ' | head -1 | \
sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p')
fi fi
if [ -n "$gitsvn" ] ; then if [ -n "$gitsvn" ] ; then
svn=" r${gitsvn}" svn=" r${gitsvn}"
@ -253,7 +253,7 @@ if [ -n "$git_cmd" ] ; then
git=" ${git}" git=" ${git}"
fi fi
fi fi
git_b=`$git_cmd rev-parse --abbrev-ref HEAD` git_b=$($git_cmd rev-parse --abbrev-ref HEAD)
if [ -n "$git_b" ] ; then if [ -n "$git_b" ] ; then
git="${git}(${git_b})" git="${git}(${git_b})"
fi fi
@ -264,9 +264,9 @@ if [ -n "$git_cmd" ] ; then
fi fi
if [ -n "$hg_cmd" ] ; then if [ -n "$hg_cmd" ] ; then
hg=`$hg_cmd id 2>/dev/null` hg=$($hg_cmd id 2>/dev/null)
hgsvn=`$hg_cmd svn info 2>/dev/null | \ hgsvn=$($hg_cmd svn info 2>/dev/null | \
awk -F': ' '/Revision/ { print $2 }'` awk -F': ' '/Revision/ { print $2 }')
if [ -n "$hgsvn" ] ; then if [ -n "$hgsvn" ] ; then
svn=" r${hgsvn}" svn=" r${hgsvn}"
fi fi