On 12 Apr 2017 11:43, Christos Kotsi wrote: > # Tweak the livecd make.conf so that users know not to edit it > # https://bugs.gentoo.org/144647 > -mv ${clst_make_conf} ${clst_make_conf}.old > -echo "####################################################" >> > ${clst_make_conf} > -echo "## ATTENTION: THIS IS THE MAKE.CONF ON THE LIVECD ##" >> > ${clst_make_conf} > -echo "## PLEASE EDIT /mnt/gentoo${clst_make_conf} INSTEAD ##" >> > ${clst_make_conf} > -echo "####################################################" >> > ${clst_make_conf} > -cat ${clst_make_conf}.old >> ${clst_make_conf} > - > +echo -e "####################################################\n$(cat > ${clst_make_conf})" > ${clst_make_conf} > +echo -e "## PLEASE EDIT /mnt/gentoo${clst_make_conf} INSTEAD > ##\n$(cat ${clst_make_conf})" > ${clst_make_conf} > +echo -e "## ATTENTION: THIS IS THE MAKE.CONF ON THE LIVECD ##\n$(cat > ${clst_make_conf})" > ${clst_make_conf} > +echo -e "####################################################\n$(cat > ${clst_make_conf})" > ${clst_make_conf}
this is not an improvement:
- the constant cat at the end is ugly
- use of `echo -e` is discouraged
- you've incorrectly changed some things to tabs
you could write it instead:
old_conf=$(cat "${clst_make_conf}")
(
echo ...all...
echo ...the...
echo ...things...
echo "${old_conf}"
) > "${clst_make_conf}"
-mike
signature.asc
Description: Digital signature
