Article 5JQ0X [SOLVED] Deleting char(s) preceding / on first line in file

[SOLVED] Deleting char(s) preceding / on first line in file

by
__John_L.
from LinuxQuestions.org on (#5JQ0X)
After many attempts, this fails:

Code:sed -i -E "1 s/.*\/(.*$)/\/\1/" myfile.txtFor example, myfile.txt of:
blah/de-blah
...

produces:
/
...

NOT:
/de-blah
...

Thanks in advance for any insight you can provide.latest?d=yIl2AUoC8zA latest?i=wCvo1tLvPlk:rDDdWobxL1w:F7zBnMy latest?i=wCvo1tLvPlk:rDDdWobxL1w:V_sGLiP latest?d=qj6IDK7rITs latest?i=wCvo1tLvPlk:rDDdWobxL1w:gIN9vFwwCvo1tLvPlk
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments