I use the following sed command to remove the line number string from file
sed -i s'/line number//g' file
but what I need to change in sed syntax in order to remove the line number
only if it exist in the last line of the file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure I fully understand your question, however this can help you :
This will perform substitution only on last line (because of
$), replacingline numberby nothing.man sed, section Addresses can help you understand how to apply sed commands on part of the text.