Just FYI since I don't know specifically what you got. Shifter and brake cables used to be pretty much the same diameters back in the old days. But with indexed shifting and other things coming into the picture, shift cables became thinner diameters.
So if you buy bare cable, be aware that it might not fit another housing made by some other manufacturer.