Here's the output of a grep command I ran:
[user@localhost] : ~/Documents/challenge $ grep -i -e ".\{32\}" fileA fileB fileA:W0mMhUcRRnG8dcghE4qvk3JA9lGt8nDl fileB:observacion = new Observacion(); fileB:observacion.setCodigoOf(ordenBO.getCodigo()); fileB:observacion.setDetalle(of.getObservacion().getSolicitante()); fileB:observacion.setTipoObservacion(TipoObservacionOrdenFleteMaestro.SOLICITANTE); fileB:observacion.setProceso(TipoProcesoObservacionMaestro.MODIFICACION); fileB:observacion.setFecha(Utiles.getFechaSistema()); fileB:java.util.Date fechaHora = Calendar.getInstance().getTime(); fileB:observacion.setUsuarioCrecion(usuarioSesionado.getUsuario().getUsuario()); fileB:daoObservacion.agregaObservacion(observacion); I'm looking for 32 character long string in two files: fileA and fileB. Importantly, fileA contains exactly 32 characters only, with no line breaks:
[user@localhost] : ~/Documents/challenge $ hexdump -C fileA 00000000 57 30 6d 4d 68 55 63 52 52 6e 47 38 64 63 67 68 |W0mMhUcRRnG8dcgh| 00000010 45 34 71 76 6b 33 4a 41 39 6c 47 74 38 6e 44 6c |E4qvk3JA9lGt8nDl| 00000020 The problem with my grep command is that it is returning any line that has more than 32 chars. How can I make it return only lines with exactly 32 chars. The issue for me is that I can't modify my regex to match on a line break, because there is no line break.
My expected output would be simply:
fileA:W0mMhUcRRnG8dcghE4qvk3JA9lGt8nDl (note: this is for a challenge that I've already solved with my ugly solution, but in this scenario we can only use grep and piping or redirecting output is not allowed)