What is the function of a bacterial cell wall?

the cell wall gives the bacteria its shape and aside that protects the bacteria from bursting due to high osmotic pressure that can be built in the cell..