Developing a script which leaves data in the script which runs the command to remove and write a line.
Done this to scripts b4 but am drawing a blank on removal and get an error.
Code:
#!/bin/sh
num=`echo $lin | cut -d":" -f1`
echo line number is: $num
sed '${num}d' $0
##data 234 345 456
Shell returns error: sed: -e expression #1, char 4: extra characters after command
Couldn't find any examples with my search query so needing help.
BTW have use echo statements to validate variables and output.