Saltar al contenido ForoHackers

Bash has discovered a photograph called *.jpg. I would quite like to see it.

DepuraciónScripts de shell
#15375 · · Citar · Denunciar

Tiny personal script, nothing clever: for f in *.jpg; do printf 'photo: %s\n' "$f"; done. In a directory with two pictures it prints both names. In an empty directory I get a solemn line reading photo: *.jpg. There is no bloody photograph. Where did Bash get it?

#15668 · · Citar · Denunciar

If no file matches the pattern, Bash normally leaves the pattern text alone. You're printing the original argument. This is as close as a star has ever come to taking its own picture.

#15669 · · Citar · Denunciar

Sorted in this Bash script with shopt -s nullglob before the loop. Empty directory, no lines. Kept the quotes around "$f"; one of the real pictures is called nice hinge.jpg and it's a very nice hinge.

#15670 · · Citar · Denunciar

May we see the hinge?

#15671 · · Citar · Denunciar

My partner says this is how the garage forum thing started and I am not allowed to do it again.

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder