public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Cc: christo.kotsi@gmail.com
Subject: Re: [gentoo-catalyst] [PATCH 5/6] ln,echo and cp commands concentration
Date: Wed, 12 Apr 2017 15:24:15 -0400	[thread overview]
Message-ID: <20170412192415.GD24205@vapier> (raw)
In-Reply-To: <20170412084349.2017-5-christo.kotsi@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-04-12 19:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12  8:43 [gentoo-catalyst] [PATCH 1/6] Concentrated some cp commands Christos Kotsi
2017-04-12  8:43 ` [gentoo-catalyst] [PATCH 2/6] updated gitignore with patches directory Christos Kotsi
2017-04-12 19:20   ` Mike Frysinger
2017-04-12  8:43 ` [gentoo-catalyst] [PATCH 3/6] Concentrated export&delete_from_root lines Christos Kotsi
2017-04-12 19:24   ` Mike Frysinger
2017-04-12  8:43 ` [gentoo-catalyst] [PATCH 4/6] Added some loops Christos Kotsi
2017-04-12  8:43 ` [gentoo-catalyst] [PATCH 5/6] ln,echo and cp commands concentration Christos Kotsi
2017-04-12 19:24   ` Mike Frysinger [this message]
2017-04-12  8:43 ` [gentoo-catalyst] [PATCH 6/6] changed mkdir line for kernels/misc Christos Kotsi
2017-04-13 16:45 ` [gentoo-catalyst] [PATCH 1/6] Concentrated some cp commands Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170412192415.GD24205@vapier \
    --to=vapier@gentoo.org \
    --cc=christo.kotsi@gmail.com \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox