A recent discussion about ranges in ed(1) & vi(1) led to detailing the difference between using a comma and using a semicolon when separating the beginning/end of a range.
To clearly demonstrate the difference, create a file with 20 sequential numbers in it:
$ jot 20 > data.txt # or use seq 20
and open it to line 10:
$ ed data.txt
51
10
If you use a semicolon like
?5?;/8/n
it will search backwards from the current line (line 10) for the line containing "5" (line 5) and then from line 5 search forward to the next line containing "8" (line "8") line and print/number those 4 lines.
If instead you're on line 10 and you use a comma like
?5?,/8/n
it will search backwards for the line containing "5" (line 5), then search forwards for "8" from your starting location (line 10), landing on "18", and print/number those 14 lines.
✨ Kind 'Net Help Desk fairy by day. ✨
✨ Weird & furry Unix fairy by night. ✨
✨ Sometimes a retrocomputer fairy. ✨
✨ Pays the ComputerFairi.es bills. ✨
✨ Sparkly✨shellscript✨princess. ✨
✨ Age: Mere days younger than ✨
✨ the Intel 4004 & Unix 1st Edition. ✨
✨ Follow requests welcome. ✨
✨
✨