i carry generic cable ends and a length of aircraft cable one size smaller diameter than the oem cable... 1/16 diameter usa...
when i had a cable break... i slid the smaller diameter cable through the existing cable jacket... then affixed the cable ends and adjusted it all up...
i used it that way until i could swap out the old oem with a new oem... about a year later n it was still good...
the whole deal is less than $5 usa and easier to pack than a spare oem...
here is what the cable ends look like... available at hardware stores n autoparts stores...
round at the top lever... hex at the bottom lever...

can be loaned out to any moto broke down beside the road... can save your day... can make you a hero...
johnny