I gang

shell script that add and delete lines from a file

Hello, I need two shell scripts, one can add lines to a file use variable such as $domain, and the other shell script can delete lines in the file use similar variable such as $domain.

The file will contain records format as:

IPaddress Domain

192.168.1.1 [url removed, login to view]

192.168.1.1 [url removed, login to view]

192.168.1.1 [url removed, login to view]

192.168.1.1 [url removed, login to view]

192.168.1.1 [url removed, login to view]

192.168.1.1 [url removed, login to view]

...

The script that adds have to do a search first see if the exact record exists or not, if not, then append it to the end of the file.

The script that deletes also have to do a search first see if the exact record exists or not, if exist then delete the record.

For example, the variable $domain passed in is [url removed, login to view], then the add script will need to append "192.168.1.1 domain.com" without the quotes at the end of the file, the delete script will need to search for "192.168.1.1 domain.com" this exact string and if a line match it exactly then delete that line.

Budget will be low since the project should be simple.

Thanks

Færdigheder: Linux

Se mere: shell script delete line, shell script remove line, delete line file shell, delete lines shell script, shell script remove domain, script remove line, shell remove lines cut, delete line files linux, delete line shell script, script delete line file, shell remove line file, shell script delete files, shell script projects free, deleting lines shell script, shell script delete lines, delete file shell script, string match, match string, from quotes, remove lines shell script, remove line file script

Om arbejdsgiveren:
( 4 bedømmelser ) Shanghai, United States

Projekt-ID: #110643