-1

I have those line on a text file

36) 
SIGCANCEL
37) 
SIGLOST
38)
SIGXRES
39)
SIGJVM1
40)
SIGJVM2
41)
SIGRTMIN
42)
SIGRTMIN+1
43)
SIGRTMIN+2
44)
SIGRTMIN+3
45)
SIGRTMAX-3
46)
SIGRTMAX-2
47)
SIGRTMAX-1
48)
SIGRTMAX

I want to substitute using sed so the lines become

SIGRTMAX-3
SIGRTMAX-2
SIGRTMAX-1

I have tried those commands,but none work

sed s/^[0-9]\)//g
sed s/^[0-9])//g

also using the -e switch produce nothing.

  • Try sed s/^[0-9]\+)// – Costas Aug 22 '15 at 20:09
  • Sorry it doesn't work – elbarna Aug 22 '15 at 20:30
  • 1
    sed s/^[0-9][0-9]*)// – Costas Aug 22 '15 at 20:34
  • This yes,works thanks,put as asnwer,i can vote it – elbarna Aug 22 '15 at 20:54
2

Substitute is not needed, you can simply delete lines starting by a digit :

sed '/^[0-9]/d'

And if you really must use substitution :

sed 's/^[0-9].*//'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.