[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

SED numbered buffer,

How do I change the slash of the path into space?
/bin/date
/bin/programs/cal
/usr/bin/date
/usr/report/file1
/usr/report/letters/lett1
/spool/mails

should look like

/bin date
/bin/programs cal
/usr/bin date
/usr/report file1
/usr/report/letters lett1
/spool mails
0
d2marcelo
Asked:
d2marcelo
  • 3
1 Solution
 
wnrossCommented:
sed 's#/([^/]*)$# \1#'

Cheers
-Bill
0
 
wnrossCommented:
Oh, the shell will muck you up, so you have to escape the ( )

 sed 's#/\([^/]*\)$# \1#'

Sorry about that

If you want to read that, it says
"Match a single / and group ( ) the rest up to the end of the line ($).  The text in the group
must NOT "^" be a forward slash."
"Replace with a single space and everything in group #1"
0
 
wnrossCommented:
Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now