Re: Not so useless use of cat

2014-09-16 Thread Bob Proulx
Chet Ramey wrote: > Bob Proulx wrote: > > That is one of the reasons I don't like the /dev/std{err,in,out} > > things. They are not portable. They do different things on different > > systems. I avoid them. > > I've considered emulating it everywhere, regardless of what the OS > provides, but I

Re: Not so useless use of cat

2014-09-16 Thread Chet Ramey
On 9/16/14, 3:00 PM, Bob Proulx wrote: > That is one of the reasons I don't like the /dev/std{err,in,out} > things. They are not portable. They do different things on different > systems. I avoid them. I've considered emulating it everywhere, regardless of what the OS provides, but I'd get jus

Re: Not so useless use of cat

2014-09-16 Thread Dennis Williamson
On Tue, Sep 16, 2014 at 2:03 AM, Ralf Goertz wrote: > Am Sat, 13 Sep 2014 12:53:48 -0600 > schrieb Bob Proulx : > > > > Dennis Williamson wrote: > > > Bob Proulx wrote: > > > > { for i in file[12] ; do cat "$i" ; done ;} > both > > > > There's no need for the curly braces and the last semicolon

Re: Not so useless use of cat

2014-09-16 Thread Bob Proulx
Greg Wooledge wrote: > It's important to note that the following two cases are *not* > equivalent: > >cat "$i" >/dev/stdout >program -i "$i" -o /dev/stdout > > In the first case, the /dev/stdout is part of a redirection. On > platforms that do not have a native /dev/stdout in the file sy

Re: Invalid pointer when misuse hash/string

2014-09-16 Thread Chet Ramey
On 9/16/14, 2:47 AM, Martin Bruchanov wrote: > Hello, > > > I've found this bug, when changed an string variable to hash, but left the > following code for test of zero code. It happens just inside function. I'm > using 4.1.2(1)-release, Thanks for the report. This was fixed around four year

Re: Not so useless use of cat

2014-09-16 Thread Greg Wooledge
On Tue, Sep 16, 2014 at 09:03:20AM +0200, Ralf Goertz wrote: > Actually things are more complicated. I do need the /dev/stdout part. I > obiously don't have the problem with `cat' but with some other program > $ for i in file[12] ; do program -i "$i" -o /dev/stdout ; done > outfile It's important

Invalid pointer when misuse hash/string

2014-09-16 Thread Martin Bruchanov
Hello, I've found this bug, when changed an string variable to hash, but left the following code for test of zero code. It happens just inside function. I'm using 4.1.2(1)-release, BASH=/bin/bash BASHOPTS=checkwinsize:cmdhist:expand_aliases:extquote:force_fignore:hostcomplete:interactive_co

Re: Not so useless use of cat

2014-09-16 Thread Bob Proulx
Ralf Goertz wrote: > Actually things are more complicated. I do need the /dev/stdout part. I > obiously don't have the problem with `cat' but with some other program > that doesn't write to stdout per se and expects a -o parameter for the > output file. And this program just accepts one input file.

Re: Not so useless use of cat

2014-09-16 Thread Ralf Goertz
Am Sat, 13 Sep 2014 12:53:48 -0600 schrieb Bob Proulx : > Dennis Williamson wrote: > > Bob Proulx wrote: > > > { for i in file[12] ; do cat "$i" ; done ;} > both > > There's no need for the curly braces and the last semicolon. > > Of course you are totally right. I was distracted by the subs