I\'m trying to remove a specific line from a file and then append the edited line to the file. I get last part right but my sed command to remove the old line is not working. >
In this case you need do this because $ means end of line regular expressions.
$
Try:
sed "/^${userinput}/d" file1.txt >> file2.txt
Also >> will append to the file.
>>