Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14291 > unrolled thread

Re: Redirect to variable

Started byRobert Durkacz <robert.durkacz@gmail.com>
First post2018-07-03 22:43 +1000
Last post2018-07-03 22:43 +1000
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug


Contents

  Re: Redirect to variable Robert Durkacz <robert.durkacz@gmail.com> - 2018-07-03 22:43 +1000

#14291 — Re: Redirect to variable

FromRobert Durkacz <robert.durkacz@gmail.com>
Date2018-07-03 22:43 +1000
SubjectRe: Redirect to variable
Message-ID<mailman.3000.1530621815.1292.bug-bash@gnu.org>
On 5/21/18 Chet Ramey wrote:


> What you're asking for is syntactic sugar for:

> some-command > temp-file
> echo '#' >> temp-file
> variablename=$(< temp-file)
> rm -f temp-file
> variablename=${variablename%?}

> I would look at a sample implementation, possibly using mmap, if someone
did one.

Could someone please explain the reason for inserting and removing the #
character. It is as if to ensure temp-file is non-empty but it seems to me
it would work anyway.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web