Hey im trying to teach myself linux but am finding it difficult, came across some questions that i should be able to do, but cant.
can anyone know the answers or able to give me hints or where to look for the answers?
A Write a Bourne shell script that eliminates the dangers associated with rm. Use the following specification:
NAME
Del – delete a file interactively
SYNOPSIS
Del filename
DESCRIPTION
This is the outline for del:
Select sh
Get the filename from the command line ($1)
If there is no file with that name
Print an error message
Otherwise
Ask if the user wants to delete the file
Read the users choice (y/n)
If the choice is yes (y)
Remove the file and print a message
Otherwise
Print a message
B Give separate grep commands to select all lines in the file emp.lst which (i) begin with the digit 2 and (ii) end with a number between 70000 and 89999. Show how you would extend the ls command with grep in order to locate all files in the current directory which are themselves directories.
C Give an egrep command which selects lines containing Wilcox , wilcocks, woodhouse or woodcock in the file emp.lst. Give an egrep command to select lines containing Truman or trueman in emp.lst