Spectral indices from relativistic and non-relativistic shocks