for x in "$@" ; do
if [ -L "${x}" ] ; then
cp "${x}" "${T}"
- mysrc="${T}"/`/usr/bin/basename "${x}"`
+ mysrc="${T}"/$(/usr/bin/basename "${x}")
elif [ -d "${x}" ] ; then
echo "doexe: warning, skipping directory ${x}"
continue
bn="$(basename $i)"
if [ -f "$pf" ] ; then
- oldcp=`grep "CLASSPATH=" "$pf" | sed "s/CLASSPATH=//"`
+ oldcp=$(grep "CLASSPATH=" "$pf" | sed "s/CLASSPATH=//")
grep -v "CLASSPATH=" "$pf" > "${pf}.new"
echo "CLASSPATH=${oldcp}:${jardest}${bn}" >> "${pf}.new"
mv "${pf}.new" "$pf"
echo "!!! The following are listed in SRC_URI for ${PN}:"
local x
- for x in `echo ${SRC_URI}`; do
+ for x in $(echo ${SRC_URI}); do
echo "!!! ${x}"
done
}
# level the QA interceptors if we're in depend
if hasq "depend" "$@"; then
for BIN in ${QA_INTERCEPTORS}; do
- BIN_PATH=`type -pf ${BIN}`
+ BIN_PATH=$(type -pf ${BIN})
if [ "$?" != "0" ]; then
BODY="echo \"*** missing command: ${BIN}\" >&2; return 127"
else
# Make it group writable. 666&~002==664
umask 002
- #the extra `echo` commands remove newlines
- echo `echo "$DEPEND"` > $dbkey
- echo `echo "$RDEPEND"` >> $dbkey
- echo `echo "$SLOT"` >> $dbkey
- echo `echo "$SRC_URI"` >> $dbkey
- echo `echo "$RESTRICT"` >> $dbkey
- echo `echo "$HOMEPAGE"` >> $dbkey
- echo `echo "$LICENSE"` >> $dbkey
- echo `echo "$DESCRIPTION"` >> $dbkey
- echo `echo "$KEYWORDS"` >> $dbkey
- echo `echo "$INHERITED"` >> $dbkey
- echo `echo "$IUSE"` >> $dbkey
+ #the extra $(echo) commands remove newlines
+ echo $(echo "$DEPEND") > $dbkey
+ echo $(echo "$RDEPEND") >> $dbkey
+ echo $(echo "$SLOT") >> $dbkey
+ echo $(echo "$SRC_URI") >> $dbkey
+ echo $(echo "$RESTRICT") >> $dbkey
+ echo $(echo "$HOMEPAGE") >> $dbkey
+ echo $(echo "$LICENSE") >> $dbkey
+ echo $(echo "$DESCRIPTION") >> $dbkey
+ echo $(echo "$KEYWORDS") >> $dbkey
+ echo $(echo "$INHERITED") >> $dbkey
+ echo $(echo "$IUSE") >> $dbkey
echo >> $dbkey
- echo `echo "$PDEPEND"` >> $dbkey
- echo `echo "$PROVIDE"` >> $dbkey
- echo `echo "${EAPI:-0}"` >> $dbkey
- echo `echo "$UNUSED_01"` >> $dbkey
- echo `echo "$UNUSED_02"` >> $dbkey
- echo `echo "$UNUSED_03"` >> $dbkey
- echo `echo "$UNUSED_04"` >> $dbkey
- echo `echo "$UNUSED_05"` >> $dbkey
- echo `echo "$UNUSED_06"` >> $dbkey
- echo `echo "$UNUSED_07"` >> $dbkey
+ echo $(echo "$PDEPEND") >> $dbkey
+ echo $(echo "$PROVIDE") >> $dbkey
+ echo $(echo "${EAPI:-0}") >> $dbkey
+ echo $(echo "$UNUSED_01") >> $dbkey
+ echo $(echo "$UNUSED_02") >> $dbkey
+ echo $(echo "$UNUSED_03") >> $dbkey
+ echo $(echo "$UNUSED_04") >> $dbkey
+ echo $(echo "$UNUSED_05") >> $dbkey
+ echo $(echo "$UNUSED_06") >> $dbkey
+ echo $(echo "$UNUSED_07") >> $dbkey
set +f
#make sure it is writable by our group:
exit 0
[ ! -d ${path} ] && continue
ofile=""
- for file in `find ${path}/ -iname '._cfg????_*' ! -name '.*~' ! -name '.*.bak' |
+ for file in $(find ${path}/ -iname '._cfg????_*' ! -name '.*~' ! -name '.*.bak' |
sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
- sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'`; do
- rpath=`echo "${file/\/\///}" | sed -e "s:/[^/]*$::"`
- rfile=`echo "${file/\/\///}" | sed -e "s:^.*/::"`
+ sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'); do
+ rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")
+ rfile=$(echo "${file/\/\///}" | sed -e "s:^.*/::")
for mpath in ${CONFIG_PROTECT_MASK}; do
if [[ "${rpath}" == "${mpath}"* ]]; then
mv ${rpath}/${rfile} ${rpath}/${rfile:10}
diff -Bbua ${rpath}/${rfile} ${rpath}/${rfile:10} | egrep '^[+-]' | egrep -v '^[+-][\t ]*#|^--- |^\+\+\+ ' | egrep -qv '^[-+][\t ]*$'
MATCHES=$?
fi
- elif [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}|
- grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then
+ elif [[ -z $(diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}|
+ grep "^[+-][^+-]"|grep -v '# .Header:.*') ]]; then
MATCHES=1
fi
if [[ "${MATCHES}" == "1" ]]; then
fi
fi
- if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}|
- grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then
+ if [[ -z $(diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}|
+ grep "^[+-][^+-]"|grep -v '# .Header:.*') ]]; then
mv ${rpath}/${rfile} ${rpath}/${ofile}
continue
else
read my_input
else
dialog --title "${title}" --menu "${my_title}" \
- 0 0 0 `echo -e "$(<${TMP}/menuitems)\n${fcount} Exit"` \
+ 0 0 0 $(echo -e "$(<${TMP}/menuitems)\n${fcount} Exit") \
2> ${TMP}/input || die "User termination!" 0
my_input=$(<${TMP}/input)
fi
until (( ${my_input} == -1 )); do
echo "Merging ${file} and ${ofile}"
- `echo "${merge_command}" |
+ $(echo "${merge_command}" |
sed -e "s:%merged:${mfile}:g" \
-e "s:%orig:${ofile}:g" \
- -e "s:%new:${file}:g"`
+ -e "s:%new:${file}:g")
until (( ${my_input} == -1 )); do
echo -n "1) Replace ${ofile} with merged file
2) Show differences between merged file and original
return 255
;;
2) ( echo "Showing differences between ${ofile} and ${mfile}"
- `echo "${diff_command}" | \
+ $(echo "${diff_command}" | \
sed -e "s:%file1:${ofile}:" \
- -e "s:%file2:${mfile}:"` ) | ${pager}
+ -e "s:%file2:${mfile}:") ) | ${pager}
continue
;;
3) break
CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT_MASK)
# load etc-config's configuration
-EU_AUTOMERGE=`get_config eu_automerge`
-rm_opts=`get_config rm_opts`
-mv_opts=`get_config mv_opts`
-cp_opts=`get_config cp_opts`
-pager=`get_config pager`
-diff_command=`get_config diff_command`
-using_editor=`get_config using_editor`
-merge_command=`get_config merge_command`
-declare -i mode=`get_config mode`
+EU_AUTOMERGE=$(get_config eu_automerge)
+rm_opts=$(get_config rm_opts)
+mv_opts=$(get_config mv_opts)
+cp_opts=$(get_config cp_opts)
+pager=$(get_config pager)
+diff_command=$(get_config diff_command)
+using_editor=$(get_config using_editor)
+merge_command=$(get_config merge_command)
+declare -i mode=$(get_config mode)
[ -z ${mode} ] && mode=0
[ -z "${pager}" ] && pager="cat"
ulimit -c 0
-filelist=`sed "s/['\"]/\\\&/g"`
-exelist=`echo $filelist | $XARGS file | grep ":.*executable" | cut -d: -f1 `
-scriptlist=`echo $filelist | $XARGS file | egrep ":.* (commands|script) " | cut -d: -f1 `
-liblist=`echo $filelist | $XARGS file | grep ":.*shared object" | cut -d : -f1 `
+filelist=$(sed "s/['\"]/\\\&/g")
+exelist=$(echo $filelist | $XARGS file | grep ":.*executable" | cut -d: -f1 )
+scriptlist=$(echo $filelist | $XARGS file | egrep ":.* (commands|script) " | cut -d: -f1 )
+liblist=$(echo $filelist | $XARGS file | grep ":.*shared object" | cut -d : -f1 )
for f in $exelist; do
if [ -x $f ]; then
set_colors() {
COLS=${COLUMNS:-0} # bash's internal COLUMNS variable
- (( COLS == 0 )) && COLS=$(set -- `stty size 2>/dev/null` ; echo $2)
+ (( COLS == 0 )) && COLS=$(set -- $(stty size 2>/dev/null) ; echo $2)
(( COLS > 0 )) || (( COLS = 80 ))
COLS=$((${COLS} - 8)) # width of [ ok ] == 7
echo ">>> Preforming suid scan in ${IMAGE}"
for i in $(find ${IMAGE}/ -type f \( -perm -4000 -o -perm -2000 \) ); do
if [ -s "${sfconf}" ]; then
- suid="`grep ^${i/${IMAGE}/}$ ${sfconf}`"
+ suid="$(grep ^${i/${IMAGE}/}$ ${sfconf})"
if [ "${suid}" = "${i/${IMAGE}/}" ]; then
echo "- ${i/${IMAGE}/} is an approved suid file"
else
# can easly be bypassed using the addwrite() function
addwrite "${sfconf}"
echo ">>> Appending commented out entry to ${sfconf} for ${PF}"
- ls_ret=`ls -ldh "${i}"`
+ ls_ret=$(ls -ldh "${i}")
echo "## ${ls_ret%${IMAGE}*}${ls_ret#*${IMAGE}}" >> ${sfconf}
echo "#${i/${IMAGE}/}" >> ${sfconf}
# no delwrite() eh?
# Distributed under the terms of the GNU General Public License v2
# $Id: /var/cvsroot/gentoo-src/portage/bin/prepalldocs,v 1.6 2004/10/04 13:56:50 vapier Exp $
-z="`find "${D}"usr/share/doc \( -type f -or -type l \) -not -name "*.gz" -not -name "*.js" 2>/dev/null`"
+z="$(find "${D}"usr/share/doc \( -type f -or -type l \) -not -name "*.gz" -not -name "*.js" 2>/dev/null)"
for y in ${z} ; do
if [ -L "${y}" ] ; then
# Symlink ...
mylink="${y}"
- linkto="`readlink "${y}"`"
+ linkto="$(readlink "${y}")"
if [ "${linkto##*.}" != "gz" ] ; then
linkto="${linkto}.gz"
rm -f "${z}"/{dir,dir.info,dir.info.gz}
-for x in `find "${z}"/ -mindepth 1 -maxdepth 1 \( -type f -or -type l \) 2>/dev/null` ; do
+for x in $(find "${z}"/ -mindepth 1 -maxdepth 1 \( -type f -or -type l \) 2>/dev/null) ; do
if [ -L "${x}" ] ; then
# Symlink ...
mylink="${x}"
- linkto="`readlink "${x}"`"
+ linkto="$(readlink "${x}")"
if [ "${linkto##*.}" != "gz" ] ; then
linkto="${linkto}.gz"
# Resulting tbz2 file will be created in ${PKGDIR} ...
# default is /usr/portage/packages/All/
-if [ "`whoami`" != "root" ] ; then
+if [ "${UID}" != "0" ] ; then
echo "You must run this as root"
exit 1
fi