The feasibility of a mean-field dynamo in nonhelical turbulence with superimposed linear shear is studied numerically in elongated shearing boxes. Exponential growth of magnetic field at scales much larger than the outer scale of the turbulence is found. The charateristic scale of the field is l_B ~ S^{-1/2} and growth rate is gamma ~ S, where S is the shearing rate. This newly discovered shear dynamo effect potentially represents a very generic mechanism for generating large-scale magnetic fields in a broad class of astrophysical systems with spatially coherent mean flows.