How to delete a line from a text file with shell script programming
In my shell script programming, I created a text file that contains a number of records, and I want to delete a specific line after after locating it.
I am using the sed instruction to find the line number of the record that I want to delete it, but actually I don't know what commnd should I use to do it.
Take Note: I want to shift up all the records inside my file after deleting a specific record some where in the middle.
My sed command to locate the line no. is:
Thanks for your support in advance
"I want to delete a specific line after after locating it. "
sed will delete a line of text with the d command. I am not sure how to work the syntax into your existing command. This is my first stab at it.
LI_NO=$(sed "/192.168.8.1/d" client_ip_addresses)
Be prepared. Create a LifeBoat CD.
|All times are GMT -5. The time now is 05:27 AM.|