emptygif
Language: English

All languages and frameworks

printf (Bash, zsh) Shell

A Shell snippet for printf (Bash, zsh) that answers requests for /pixel.gif with the empty GIF, decoded once at startup.

printf (Bash, zsh) Shell

File
pixel.sh
# %b expands the \xHH escapes (bash and zsh builtins; POSIX sh lacks \x - use base64 -d).
printf '%b' '\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xff\xff\xff\x00\x00\x00\x21\xf9\x04\x01\x00\x00\x00\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b' > pixel.gif

We ran this snippet and compared the bytes it returned.

Official site: printf (Bash, zsh)

More in Shell