[Gllug] Extracting part of string in bash script

Alexandre Abreu alexandre.abreu at gmail.com
Wed Apr 13 12:35:38 UTC 2005


Hi all

On 4/13/05, Ian Norton <bredroll at darkspace.org.uk> wrote:
> On Sat, Apr 09, 2005 at 07:29:05AM +0100, Dylan wrote:
> > Hi All,
> >
> > I'm putting together a script to rename ogg files according to the
> > file's tags. Using ogginfo and grep, I can isolate the relevant tags
> > like:
> >
> > ARTIST=Queen
> >
> > How can I extract the artist name and discard the rest of the line?

Ian, put the output on variables so you can do the trick below:

[inode at localhost ~]$ var="ARTIST=Queen"
[inode at localhost ~]$ echo ${var#*=}
Queen
[inode at localhost ~]$

Cheers

-- 
Alexandre de Abreu, GCUX, RHCE, LPIC-2
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list