Re: Redirect to variable

2018-07-03 Thread Greg Wooledge
On Tue, Jul 03, 2018 at 10:43:31PM +1000, Robert Durkacz wrote: > 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%?} >

Re: Redirect to variable

2018-07-03 Thread Ilkka Virta
On 3.7. 15:43, Robert Durkacz wrote: 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

Re: Redirect to variable

2018-07-03 Thread Robert Durkacz
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.

Re: Redirect to variable

2018-05-21 Thread Greg Wooledge
On Mon, May 21, 2018 at 10:12:43AM -0400, Chet Ramey wrote: > On 5/20/18 10:21 PM, PePa wrote: > > I would like to do something like this, where output gets redirected > > into a variable: > > > > some-command >>> variablename1 2>>>variablename2 > > > > command-with-many-output-descriptors >>> va

Re: Redirect to variable

2018-05-21 Thread Chet Ramey
On 5/20/18 10:21 PM, PePa wrote: > I would like to do something like this, where output gets redirected > into a variable: > > some-command >>> variablename1 2>>>variablename2 > > command-with-many-output-descriptors >>> var1 3>>> var3 4>>> var4 > > The idea is not needing files to be created bu