В Птн, 24/06/2011 в 18:22 +0200, Jeroen Roovers пишет:
> On Fri, 24 Jun 2011 10:29:51 +0400
> Peter Volkov <[email protected]> wrote:
>
> > > src_prepare() {
> > > echo "./logos/gentoo.logo" >> logo_config
> > > echo "./logos/gentoo2.logo" >> logo_config
> > > echo "./logos/banner-simplified.logo" >> logo_config
> > > echo "./logos/banner.logo" >> logo_config
> > > echo "./logos/classic-no_periods.logo" >> logo_config
> > > echo "./logos/classic-no_periods_or_chars.logo" >>
> > > logo_config echo "./logos/classic.logo" >> logo_config
> >
> > cat >> logo_config <<-EOF will look much better here.
>
> src_prepare() {
> cat >> logo_config <<EOF
> line0
> line1
> line2
> line3
> EOF
> }
>
> Since I like indenting, I don't think so. Using FILESDIR is probably
> better, as mgorny suggested.
Note '-' before EOF. With it indenting works fine. See `info bash`:
If the redirection operator is `<<-', then all leading tab
characters are stripped from input lines and the line containing
DELIMITER. This allows here-documents within shell scripts to be
indented in a natural fashion.
But ${FILESDIR} works too, although additional file IMO redundant.
--
Peter.