I am creating a basic shell script to manipulate a database as a college assignment. However, How many times I try, I can't get the sed command fully correct. The functionality where sed is to be used is this:
$name is the variable. User will supply the name via the terminal. This name will be looked up in the database and will be deleted if present.
The command I used is this:
sed -i /$name/d <filename>
However, this command only works if the entered value contains no space.
I tried out my solution by using what I could salvage from this
sed -i '/$name/d' <filename>
However, to no avail. How to go about this?