Skip to content
Advertisement

Delete a single line from a file with a unix shell script

I’m working with a simple shell script that needs to delete a single line from a file if a string entered at command line is found. Instead it deletes the entire contents of the file.

the data file is like this(each entry is on a new line):

JavaScript

my code:

JavaScript

Advertisement

Answer

JavaScript

N means the line number , begin from 1

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement