RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Pinto Elia Root: /v/rpm/cvs Email: devzero2...@rpm5.org Module: rpm Date: 02-Apr-2015 14:57:46 Branch: rpm-5_4 Handle: 2015040212574500 Modified files: (Branch: rpm-5_4) rpm/scripts rpmdb_loadcvt Log: rpmdb_loadcvt: use the $( ... \) construct for command substitution Prefer the $( ... ) construct for command substitution instead of using the back-quotes, or grave accents (`..`). The backquoted form is the historical method for command substitution, and is supported by POSIX. However, all but the simplest uses become complicated quickly. In particular, embedded command substitutions and/or the use of double quotes require careful escaping with the backslash character. Because of this the POSIX shell adopted the $(â¦) feature from the Korn shell. The patch was generated by the simple script for _f in $(find . -type f -exec file {} \; | grep -i shell | awk -F: '{ print $1 }') do perl -i -pe 'BEGIN{undef $/;} s@`(.*)`@\$($1)@smg' ${_f} done Summary: Revision Changes Path 1.1.24.1 +6 -6 rpm/scripts/rpmdb_loadcvt ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/scripts/rpmdb_loadcvt ============================================================================ $ cvs diff -u -r1.1 -r1.1.24.1 rpmdb_loadcvt --- rpm/scripts/rpmdb_loadcvt 1 Mar 2003 20:23:39 -0000 1.1 +++ rpm/scripts/rpmdb_loadcvt 2 Apr 2015 12:57:45 -0000 1.1.24.1 @@ -1,21 +1,21 @@ #!/bin/bash ac=$# -cmd=`basename $0` +cmd=$(basename $0) rpmdb=/var/lib/rpm -dbfiles="`/bin/ls -1 $rpmdb/*`" +dbfiles="$(/bin/ls -1 $rpmdb/*)" dbdump=/usr/lib/rpm/rpmdb_dump dbload=/usr/bin/db_load -set `$dbdump -V` || { +set $($dbdump -V) || { echo "The file $dbdump, usually in the rpm-devel package, is needed." echo " Please install the rpm-devel package and retry $cmd." exit 1 } dumpfmt="${5%%:}" -set `$dbload -V` || { +set $($dbload -V) || { echo "The file $dbload, usually in the db4-utils package, is needed." echo " Please install the db4_utils package and retry $cmd." exit 1 @@ -28,7 +28,7 @@ exit 0 } -[ "$ac" != "0" -o "`/usr/bin/id -u`" != "0" ] && { +[ "$ac" != "0" -o "$(/usr/bin/id -u)" != "0" ] && { echo "$cmd: Convert $rpmdb files to db-$loadfmt format." echo "$cmd: Must be run as root, takes no arguments." exit 1 @@ -49,7 +49,7 @@ for dbfile in $dbfiles do - echo " `/usr/bin/file $dbfile`" + echo " $(/usr/bin/file $dbfile)" $dbdump $dbfile | $dbload $dbfile-N || { echo "Failed conversion:" @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org