line_index=\"2d\"; file=\"./Desktop/books.sh\"; sed -i.bak -e $line_index $file
Will delete the entire line that $line_index is pointing to
Sure, "addresses" and "commands" can be freely combined:
sed '2s/harry/potter/g'