0

grep -v "#EXTINF:" All.m3u | sed 's#../##'g

I'm using the line above to try and make the playlists that I export from Banshee compatible with my digital music player. When I run the sed portion of this script I'm trying to remove the portion of the path up to where the music directories actually start. I jus want the .m3u file to be a list of lines containing Artists/Album/Title.flac

But when I run this script it's removing all of the forward slashes /, not just the beginning ../
Can anyone tell me why it's removing all of the forward slashes and what I might be able to do about it? Thanks.

2
Contributors
1
Reply
21
Views
11 Months
Discussion Span
Last Post by rubberman
1

You need to read up on sed and Linux/Unix regular expressions. The dot (.) has a special meaning - ie, any character. You need to preface each with an escape back slash (in a shell, two back slashes) to tell the tool to consider only a dot. Also, forward slashes are expression separators. They also need to be escaped like the dots. Try some experimentation until the output reflects your intention.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.