4 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for AndrisP

How i can `sed` save pattern matches to variables and do something with it? eg $ echo "string_4.3.2" | sed 's/^string_\([0-9]\)\.\([0-9]\)\.\([0-9]\)$/\1 \2 \3/' output "4 3 2" but I want to pass variables to function eg do_something() { echo $1 echo $2 echo $3 # ..... # ..... } string="string_4.3.2" …

Member Avatar for AndrisP
0
821
Member Avatar for lewashby

`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 …

Member Avatar for rubberman
0
335
Member Avatar for msrikanth

Hi Everyone, I need a replace a string (ex : this) with the string (ex : that) in each line of a file (sample.txt) using a C Shell Script and I am not allowed to use sed,awk and replace command in the unix , So i tried to use tr …

Member Avatar for histrungalot
0
7K
Member Avatar for kristo5747

Greetings. I am using SED to cleanup files that are laid out like so: [icode] ReceiverID=028936004663 SerialNumber=WD-WCAV95708405 Currenttemp=44C PowerOnHours=3663h ReceiverID=028923894902 SerialNumber=WD-WCAV9A766701 Currenttemp=49C PowerOnHours=2215h [/icode] My boss wants files like this one to be tab ("\t") delimited like so [icode] ReceiverID=...(tab)SerialNumber=...(tab)Currenttemp=...(tab)PowerOnHours=...(newline) ReceiverID=...(tab)SerialNumber=...(tab)Currenttemp=...(tab)PowerOnHours=...(newline)... [/icode] 1) first, I added a newline to mark …

Member Avatar for kristo5747
0
149

The End.