Measure the length of the first wall you plan to lay an end cap along.
Mark the end cap with a pen where it needs to be cut to fit along the wall.
Clamp a length of end cap in a miter box and align the mark you made with a 45-degree cutting point.
Fit a handsaw into the 45-degree cutting line of the miter box and cut the end cap.
Smooth the rough edges of the cut with fine-grit sandpaper.
Repeat the process with any other lengths of end caps you need to lay along the walls.