Remove the awning from its posts and/or the structure to which it is attached.
Cut the loops that secure the broken cable or cord to the rings at each end of its run -- usually at the corners of the sun shade -- with a cable cutter in the case of a stainless steel cable or a utility knife for cord or webbing.
Pull the broken cable or cord out of the channel of fabric at the edge of the awning.
Lay the awning fabric out flat and measure the length of the channel with a measuring tape.
Cut a new length of 1/8-inch stainless steel cable, cord or webbing to measure, adding 4 inches to each end. Stainless steel cable requires a cable cutter to make a smooth cut.
Apply tape around one cut end of the stainless steel cable to keep it from catching on the fabric of the awning.
Push the taped end of the stainless steel cable into one end of the channel you removed the broken cable or cord from in Step 3. Feed it all the through the channel until you reach the other end. As you work the cable through the channel, it helps to pull the fabric of the channel down, bunching it up around the cable or wire as you go, until you reach the other end. When you reach the end, smooth the fabric out and pull it down around the other end of the wire or cord. Remove the tape from the length of cable and from the wire.
Thread a 1/8-inch ferrule, a soft metal tube, onto the cable at each end.
Put the end of the cable through the ring at the corner of the awning and loop it back on itself, threading the end back through the ferrule. Repeat on the other end.
Check to ensure that the fabric of the awning is smooth and the looped cable does not have any extra play in it. Tighten or loosen the loops as necessary.
Press down on the ferrules with the crimping tool. Trim the extra wire off close to the end of the ferrule with the cable cutter. Repeat on the other end.