"Sed" Question

2009-10-14 Thread henter2009

I have the following question about sed and methacaracters:

In the eg number 1, I escaped the +, to get any matches with 1 plus (1 or
more characters)
In the eg number 2, I escaped the *, to get any matches with 0 or more
characters, but it scape the * and takes it at literal.

Why it doesn't take + literal as well?
How does it really works?
Any help?




1.) sed -ne '/t\+/Ip'

tango
tango   > repeated
balada  > non repeated


2.) sed -ne '/t\*/Ip'

t8 
t*
t*

-- 
View this message in context: 
http://www.nabble.com/%22Sed%22-Question-tp25890151p25890151.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





Re: "Sed" Question

2009-10-14 Thread Pierre Gaston
On Wed, Oct 14, 2009 at 3:27 PM, henter2009
wrote:

>
> I have the following question about sed and methacaracters:
>
> This mailing list is mainly about the development, the features and the
bugs of bash.

sed is not really related to the shell, except that you often use it in bash
and in scripts.

Please consider asking in a sed mailing list like:

http://sed.sourceforge.net/#mailing

or maybe in the usenet group comp.unix.shell


bash for AIX installp image

2009-10-14 Thread Perry Smith

I am creating a web site with AIX installp images (instead of RPMs).

bash 3.2.48 is now available.  The path to the base web site is 
http://aix-consulting.net

Enjoy,
Perry
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems







Re: "Sed" Question

2009-10-14 Thread Bob Proulx
Pierre Gaston wrote:
> Please consider asking in a sed mailing list like:
> http://sed.sourceforge.net/#mailing
> or maybe in the usenet group comp.unix.shell

I would think help-gnu-ut...@gnu.org would be the better place to ask
for help about GNU utilities.  :-)

Bob




Re: "Sed" Question

2009-10-14 Thread Greg Wooledge
On Wed, Oct 14, 2009 at 12:24:30PM -0600, Bob Proulx wrote:
> Pierre Gaston wrote:
> > Please consider asking in a sed mailing list like:
> > http://sed.sourceforge.net/#mailing
> > or maybe in the usenet group comp.unix.shell
> 
> I would think help-gnu-ut...@gnu.org would be the better place to ask
> for help about GNU utilities.  :-)

We don't know that he's using GNU sed.




Re: "Sed" Question

2009-10-14 Thread Bob Proulx
Greg Wooledge wrote:
> Bob Proulx wrote:
> > I would think help-gnu-ut...@gnu.org would be the better place to ask
> > for help about GNU utilities.  :-)
> 
> We don't know that he's using GNU sed.

True, we don't know for sure.  But I think it likely that it is GNU
sed given the behavior.  Plus either way then we can keep gently
helping GNU and encouraging Free Software.

Bob




process substitution

2009-10-14 Thread Ralf Goertz
Hi,

is it possible to have a process substitution with both input and output
redirection? So far I use the following work-around

> cat parentprocess.sh:
#!/bin/bash
mkfifo fifo 2>/dev/null
exec 5> >(./subprocess.sh > fifo)
exec 6< <(cat < fifo)
echo input to subprocess 1>&5
echo done sending input
sleep 1
while read -u 6 ; do
echo parent process read: $REPLY
done
exec 5>&-
echo about to exit parent process rm fifo

> cat subprocess.sh:
#!/bin/bash
echo subprocess start
read
sleep 1
echo read: $REPLY
echo subprocess end
>

Is there another way to do that, something like fork, which wouldn't use
a named pipe explicitely?

Ralf


bash for AIX installp image

2009-10-14 Thread Perry Smith

I am creating a web site with AIX installp images (instead of RPMs).

bash 3.2.48 is now available.  The path to the base web site is 
http://aix-consulting.net

Enjoy,
Perry
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems







Re: process substitution

2009-10-14 Thread Pierre Gaston
On Mon, Oct 12, 2009 at 1:14 PM, Ralf Goertz
wrote:

> Hi,
>
> is it possible to have a process substitution with both input and output
> redirection? So far I use the following work-around
>
> > cat parentprocess.sh:
> #!/bin/bash
> mkfifo fifo 2>/dev/null
> exec 5> >(./subprocess.sh > fifo)
> exec 6< <(cat < fifo)
> echo input to subprocess 1>&5
> echo done sending input
> sleep 1
> while read -u 6 ; do
> echo parent process read: $REPLY
> done
> exec 5>&-
> echo about to exit parent process rm fifo
>
> > cat subprocess.sh:
> #!/bin/bash
> echo subprocess start
> read
> sleep 1
> echo read: $REPLY
> echo subprocess end
> >
>
> Is there another way to do that, something like fork, which wouldn't use
> a named pipe explicitely?
>

in bash4 you can use a coproc, see:
http://bash-hackers.org/wiki/doku.php/syntax/keywords/coproc