Re: Need help with sed statement

2010-05-05 Thread Patrick O'Callaghan
On Tue, 2010-05-04 at 23:08 +0200, Roberto Ragusa wrote: > Simplicity is many things. The syntax is unfamiliar until you learn > it, > then it becomes "simple". Your method is easier to learn, but not as > robust. > For example, your "basename $foo .txt" will fail if $foo contains a > space. > You

Re: Need help with sed statement

2010-05-05 Thread dexter
> -- >   Roberto Ragusa    mail at robertoragusa.it > -- thanks ...dex -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Re: Need help with sed statement

2010-05-04 Thread Kwan Lowe
On Tue, May 4, 2010 at 5:08 PM, Roberto Ragusa wrote: > The shell syntax is not as difficult as it looks. > The "#" operator removes a matching part at the beginning (and we are > matching "*/" so anything followed by a slash). > There are two variants: "#" and "##"; the first one tries to match

Re: Need help with sed statement

2010-05-04 Thread Roberto Ragusa
Patrick O'Callaghan wrote: > On Tue, 2010-05-04 at 14:11 +0200, Roberto Ragusa wrote: >> David Bartmess wrote: >> >>> I'm trying to express only the filename from a filepath, i.e., >>> whoopie.txt from /opt/dev/whoopie.txt. >> I see you already have received solutions. >> Here is a simpler one (no

Re: Need help with sed statement

2010-05-04 Thread Patrick O'Callaghan
On Tue, 2010-05-04 at 14:11 +0200, Roberto Ragusa wrote: > David Bartmess wrote: > > > I'm trying to express only the filename from a filepath, i.e., > > whoopie.txt from /opt/dev/whoopie.txt. > > I see you already have received solutions. > Here is a simpler one (no sed, no basename): > > COMP

Re: Need help with sed statement

2010-05-04 Thread Roberto Ragusa
David Bartmess wrote: > I'm trying to express only the filename from a filepath, i.e., > whoopie.txt from /opt/dev/whoopie.txt. I see you already have received solutions. Here is a simpler one (no sed, no basename): COMPLETEPATH=aa/bb/cc/dd ONLYFILENAME=${COMPLETEPATH##*/} -- Roberto Ragu

Re: Need help with sed statement

2010-05-03 Thread Chris Tyler
On Mon, 2010-05-03 at 21:37 -0600, David Bartmess wrote: > Not sure if this is the right place, but I need help with a sed > replacement expression. > > I'm trying to express only the filename from a filepath, i.e., > whoopie.txt from /opt/dev/whoopie.txt. > > Basically I'm reading the files th

Re: Need help with sed statement

2010-05-03 Thread Kwan Lowe
On Mon, May 3, 2010 at 11:37 PM, David Bartmess wrote: > Not sure if this is the right place, but I need help with a sed > replacement expression. > > I'm trying to express only the filename from a filepath, i.e., > whoopie.txt from /opt/dev/whoopie.txt. > > Basically I'm reading the files that ch

Re: Need help with sed statement

2010-05-03 Thread Kwan Lowe
On Mon, May 3, 2010 at 11:37 PM, David Bartmess wrote: > Not sure if this is the right place, but I need help with a sed > replacement expression. > > I'm trying to express only the filename from a filepath, i.e., > whoopie.txt from /opt/dev/whoopie.txt. > > Basically I'm reading the files that ch

Need help with sed statement

2010-05-03 Thread David Bartmess
Not sure if this is the right place, but I need help with a sed replacement expression. I'm trying to express only the filename from a filepath, i.e., whoopie.txt from /opt/dev/whoopie.txt. Basically I'm reading the files that changed into a temp file, and reading each line into a variable to