I have a list of strings that I want to remove the number and colon from the beginning of every string. How can I do this with sed
?
When using:
printf '%s\n' '1:I am a sample line 1: line' '2:schafe' '11:11:11:12:' 'a'"'" | sed 's/^[0-9]\://g'
I would like to end up with:
I am a sample line 1: line
schafe
11:11:12:
a'
however running the command above seems to leave the 11:11:11:12:
line untouched. I'd like sed
to match any size number if possible.
I am using BSD sed (from macOS) but I also have access to GNU sed if that is necessary.
Thanks
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.