I want to make a shelf which fits exactly. However the wall isn't straight, it's curved. How do I measure the shape so i can draw it and cut it on the wood for the shelf?
You use a scribing tool
You can also use regular compasses with care. Or make something up with a pencil and a piece of wood to hold the pencil and offset it.
You put the shelf next to the wall, at the height you want it, pull the scribe along the wall with the pencil or marker on the shelf - this produces a cut line.
Scribing tools would be my first choice, but just to give you an alternative, you can use cardboard. Get a big piece, about the size of your shelf, then tape/hot glue as many smaller pieces as you need to accurately follow the contours of the wall. This will be particularly helpful if your shelf is enclosed on 3 sides.
Edit to respond to the request for more information: these pictures should describe the process.
This is the space we're going to template.
Start with a chunk of cardboard that very roughly approximates the space to template. Best if you have a straight edge, aligned to the front of where the shelf will sit.
Finally, drop small bits of cardboard to establish the actual outline of the wall. I find hot glue to be ideal, though there are various ways to do this. For straight sections, use the cardboard's factory edges to advantage. If you want to be fancy, you can trim the cardboard to exactly follow curved surfaces.
Don't forget that a bit of caulk at the edge of the shelf makes up for slight inaccuracies.