Re: How can redirection operator aka ">" open output in append instead of ordinary write mode?

2020-04-17 Thread gentoo_eshoes--- via Bug reports for the GNU Bourne Again SHell
the only issue I've encountered with this so far is that 'dd' will fail some of its tests because it's not using of=  but instead using the redir operator and then it assumes it's NOT open in append mode ;)) so then it tries to seek past EOF (which doesn't work in append mode) to make holes(of z

Re: How can redirection operator aka ">" open output in append instead of ordinary write mode?

2019-05-16 Thread howaboutsynergy
‐‐‐ Original Message ‐‐‐ On Thursday, May 16, 2019 10:57 PM, Chet Ramey wrote: > On 5/16/19 4:25 PM, howaboutsyne...@protonmail.com wrote: > > > Hi. Would bash devs even consider replacing the current behaviour of ">" > > (redirection) to do the equivalent of the following(under the ho

Re: How can redirection operator aka ">" open output in append instead of ordinary write mode?

2019-05-16 Thread Chet Ramey
On 5/16/19 4:25 PM, howaboutsyne...@protonmail.com wrote: > Hi. Would bash devs even consider replacing the current behaviour of ">" > (redirection) to do the equivalent of the following(under the hood) ? I doubt it. That's not how it's defined to behave, and there's no good reason to do it. >

How can redirection operator aka ">" open output in append instead of ordinary write mode?

2019-05-16 Thread howaboutsynergy
Hi. Would bash devs even consider replacing the current behaviour of ">" (redirection) to do the equivalent of the following(under the hood) ? When: `command > $somewhere` then actually do(under the hood): : > $somewhere command >> $somewhere ie. create&truncate file, then open it in append m

Re: '>;' redirection operator

2011-12-25 Thread Roman Rakus
Feel free to write a patch. RR

Re: '>;' redirection operator

2011-12-24 Thread Gerard Seibert
On Sat, 24 Dec 2011 15:08:34 -0600 Bill Gradwohl articulated: > My original post was only to suggest that instead of more bells and > whistles, talent should be applied towards the documentation of what > is already there. Bill, it is a well known fact that the developers of a product are usually

Re: '>;' redirection operator

2011-12-24 Thread Bill Gradwohl
On Sat, Dec 24, 2011 at 1:26 PM, Chris Jones wrote: > I find it rather ironical that your rant should amount to a clumsy > rewording of section 6.1, GNU Manuals, from the GNU Coding Standards: > > http://www.gnu.org/prep/standards/html_node/GNU-Manuals.html#GNU-Manuals > > Followed that link and

Re: '>;' redirection operator

2011-12-24 Thread Chris Jones
On Sat, Dec 24, 2011 at 10:08:31AM EST, Bill Gradwohl wrote: [..] > The man page is written the way Robbie the Robot used to speak in the old > black and white TV days¹. Short, cryptic and in many cases unintelligible IN > THE DETAILS. Alternatively, one might snicker that some lawyer wrote it to

Re: '>;' redirection operator

2011-12-24 Thread Pierre Gaston
On Sat, Dec 24, 2011 at 5:08 PM, Bill Gradwohl wrote: > On Thu, Dec 22, 2011 at 5:34 PM, Thorsten Glaser wrote: > >> People complain about the readability of code enough already, and as >> practice shows, things like [[ have been around and nobody uses them >> anyway (often using just POSIX, but

Re: '>;' redirection operator

2011-12-24 Thread Bill Gradwohl
On Thu, Dec 22, 2011 at 5:34 PM, Thorsten Glaser wrote: > People complain about the readability of code enough already, and as > practice shows, things like [[ have been around and nobody uses them > anyway (often using just POSIX, but not even knowing – myself included > – that POSIX sh has $((…

Re: '>;' redirection operator

2011-12-24 Thread Thorsten Glaser
Eric Blake dixit: >powerful approach. Can we get buy-in from other shell developers to >support '>;' as an atomic temp-file replacement-on-success idiom, if Urgh, PLEASE NOT! People complain about the readability of code enough already, and as practice shows, things like [[ have been around and

Re: '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)]

2011-12-22 Thread Geir Hauge
2011/12/22 Bruce Korb > > When the exact opposite is the useful variation? I.e. keep-on-failure. > "-i" for sed is simple, understandable and implemented a lot. > As far as I know, -i is only implemented with GNU sed and BSD sed, and they are incompatible, BSD sed's -i takes a mandatory argument

Re: '>; ' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)]

2011-12-22 Thread David Korn
cc: ebl...@redhat.com bug-bash@gnu.org d...@vger.kernel.org miros-disc...@mirbsd.org Subject: Re: '>;' redirection operator [was: [1003.1(2008)/Issue 7 530]: Support in-place editing in sed (-iEXTENSION)] > On 12/22/2011 08:39 AM, David Korn wrote: > > Su

Re: '>;' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)]

2011-12-22 Thread Bruce Korb
assume that this is like any other redirection operator, where an optional fd number can be prepended, as in '2>; file' to collect stderr and overwrite file on success? When the exact opposite is the useful variation? I.e. keep-on-failure. "-i" for sed is simple, understanda

'>; ' redirection operator [was: [1003.1(2008)/Issue 7 0000530]: Support in-place editing in sed (-iEXTENSION)]

2011-12-22 Thread Eric Blake
> > There are many commands other than sed that want the output to replace > an input file. That is why I added the >; redirection operator to ksh93. > > With >; you can do > sed -e s/foo/bar/ file >; file > to do in place sed. The >; operator generates

Re: new redirection operator seems broken

2009-03-13 Thread Pierre Gaston
On Thu, Mar 12, 2009 at 10:13 PM, Chet Ramey wrote: > I wonder if I should modify it so the implicit 2>&1 happens first, right > after the pipe, so any user-specified redirections can override it.  That > doesn't seem that radical a change.  Opinions?  (I know what you think, > Andreas ;-) ). If

Re: new redirection operator seems broken

2009-03-12 Thread Chet Ramey
Greg Wooledge wrote: > On Thu, Mar 12, 2009 at 04:13:12PM -0400, Chet Ramey wrote: > $ echo >&2 |& wc -l > >> I wonder if I should modify it so the implicit 2>&1 happens first, right >> after the pipe, so any user-specified redirections can override it. That >> doesn't seem that radical a cha

Re: new redirection operator seems broken

2009-03-12 Thread Greg Wooledge
On Thu, Mar 12, 2009 at 04:13:12PM -0400, Chet Ramey wrote: > > >> $ echo >&2 |& wc -l > I wonder if I should modify it so the implicit 2>&1 happens first, right > after the pipe, so any user-specified redirections can override it. That > doesn't seem that radical a change. Opinions? (I know wh

Re: new redirection operator seems broken

2009-03-12 Thread Chet Ramey
> Greg Wooledge writes: > > > On Thu, Mar 12, 2009 at 05:21:04PM +0100, Andreas Schwab wrote: > >> Still does not fix this case: > >> > >> $ echo >&2 |& wc -l > >> > >> 0 > > > > That looks like the correct output to me. When setting up a pipeline > > with redirections, the pipeline happens fi

Re: new redirection operator seems broken

2009-03-12 Thread Andreas Schwab
Greg Wooledge writes: > On Thu, Mar 12, 2009 at 05:21:04PM +0100, Andreas Schwab wrote: >> Still does not fix this case: >> >> $ echo >&2 |& wc -l >> >> 0 > > That looks like the correct output to me. When setting up a pipeline > with redirections, the pipeline happens first. > > The manual s

Re: new redirection operator seems broken

2009-03-12 Thread Greg Wooledge
On Thu, Mar 12, 2009 at 05:21:04PM +0100, Andreas Schwab wrote: > Still does not fix this case: > > $ echo >&2 |& wc -l > > 0 That looks like the correct output to me. When setting up a pipeline with redirections, the pipeline happens first. The manual says your example should be equivalent to

Re: new redirection operator seems broken

2009-03-12 Thread Andreas Schwab
Chet Ramey writes: >> On Wed, Mar 11, 2009 at 09:50:18PM -0400, m...@ice.filescope.com wrote: >> >rm 2>&1 | grep --color op >> >rm |& grep --color op >> > >> >Notice that they are behaving differently. >> >> Confirmed in 4.0.0 and 4.0.10: > > Interesting. Only for n

Re: new redirection operator seems broken

2009-03-12 Thread Chet Ramey
> On Wed, Mar 11, 2009 at 09:50:18PM -0400, m...@ice.filescope.com wrote: > > rm 2>&1 | grep --color op > > rm |& grep --color op > > > > Notice that they are behaving differently. > > Confirmed in 4.0.0 and 4.0.10: Interesting. Only for non-builtin simple commands a

Re: new redirection operator seems broken

2009-03-12 Thread Greg Wooledge
On Wed, Mar 11, 2009 at 09:50:18PM -0400, m...@ice.filescope.com wrote: > rm 2>&1 | grep --color op > rm |& grep --color op > > Notice that they are behaving differently. Confirmed in 4.0.0 and 4.0.10: imadev:~$ rm 2>&1 | tr '[:lower:]' '[:upper:]' USAGE: RM [-R

new redirection operator seems broken

2009-03-11 Thread Matt
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: i686-pc-linux-gnu-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/loc