Results 1 to 5 of 5
His,
first time i use sed. I need to remove/delete the string "Language :"
I can remove either "Language" or ":", but "Language :" doesn't work...
e.g.:
$ echo "Subtitles: ...
- 11-08-2009 #1
[SOLVED] newbie sed question: remove Language : from string
His,
first time i use sed. I need to remove/delete the string "Language :"
I can remove either "Language" or ":", but "Language :" doesn't work...
e.g.:
$ echo "Subtitles: Language : French,Language : English,Language : Dutch,Language : German,Language : Polish,Language : French,Language : English,Language : Dutch,Language : German,Language : Polish," | sed 's/Language ://g'
help appreciated
- 11-08-2009 #2
You need to escape the spaces:
Code:echo "Language : Polish" | sed 's#Language\ :\ ##'
Linux User #453176
- 11-08-2009 #3
echo is playing tricks...
doesn't workCode:(...) ext="Audio: Language : Japanese,Language : French,Language : English,Language : German" ext=`echo "$ext" | sed 's/Language\ ://g'`
but if i substitute echo "$ext" with echo $ext, like this:
it works!Code:ext=`echo $ext | sed 's/Language\ ://g'`

maybe its time to call it a day
PS: btw:
also doesn't work............Code:ext=${ext//Language\ :/}
- 11-08-2009 #4
It seems to work for me:
Code:kieren@George-Michael:~$ ext="Audio: Language : Japanese,Language : French,Language : English,Language : German" kieren@George-Michael:~$ ext=`echo "$ext" | sed 's/Language\ ://g'` kieren@George-Michael:~$ echo $ext Audio: Japanese, French, English, German
Linux User #453176
- 11-08-2009 #5
Thanks Kieren,
i found the problem:
my $ext had extra formating characters...
in fact i don't need to escape the space in my case. Both
andCode:ext=${ext//Language :/}
work just fineCode:ext=`echo "$ext" | sed 's/Language ://g'`



