New to sed and could use some help. I would like to turn this "a/b/c a/b/c" into this "a/b/c a-b-c". where a/b/c is any path.
thanks
New to sed and could use some help. I would like to turn this "a/b/c a/b/c" into this "a/b/c a-b-c". where a/b/c is any path.
thanks
Since you want to use whitespace to delemit, I'd just use perl:
perl -ane '$F[1] =~ s/\//-/; print "@F\n"'
Give this a try:
sed 'h; s/ .*//; x; s/.* //; s:/:-:g; x; G; s/\n/ /'
you can use awk,
$ echo "a/b/c a/b/c" | awk '{gsub("/","-",$NF)}1'
a/b/c a-b-c