help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is there a way to save stdout and stderr to two bash variables?


From: Tim Visher
Subject: Re: is there a way to save stdout and stderr to two bash variables?
Date: Tue, 12 May 2020 08:57:40 -0400

On Tue, May 12, 2020 at 6:24 AM Peng Yu <address@hidden> wrote:

> > > I didn’t know that this was the case. I always thought heredoc was in
> > > memory.
> > >
> > > Chet, There was not an in memory implementation of here doc possible in
> > > bash? How much performance difference it could be comparing in memory
> and
> > > temp file (suppose temp file is not in a RAM disk)?
> >
> > Theoretically, I don't think you can assume that a here-document can be
> > stored in RAM as its size is only limited by the storage medium that
> > hold the script that it is part of.
>
>
> I am not sure this statement is relevant to most real usage. I mostly use
> heredoc for short strings, it would be costly to use external files instead
> of in memory strings.


Perhaps given that you've been using heredocs for all this time and never
noticed a problem the cost isn't as high as you imagine it could be?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]