Ancestors

Toot

Written by modulux on 2024-12-30 at 10:23

Today on "Unix is a coherent, orthogonal system," my cron job refused to run because it has unescaped % signs, which as we all know are totally a thing in any other shell context... oh wait, no they're not.

But for some reason if you put a % sign on a cron job, it assumes you wanted to do a line break, because... well, it's just logical, it's Unix.

(I rarely complain about Unix quirks but this one is weird as hell.)

=> More informations about this toot | More toots from modulux@node.isonomia.net

Descendants

Written by Amin Hollon 🏳 on 2024-12-30 at 10:24

@modulux

Hm, I think escaping % is a thing in SQL LIKE statements, but I haven't seen it anywhere else.

=> More informations about this toot | More toots from amin@polymaths.social

Written by modulux on 2024-12-30 at 10:24

@amin You're right, I think it's the comment character in some langs. But on the shell? Very strange.

=> More informations about this toot | More toots from modulux@node.isonomia.net

Written by Amin Hollon 🏳 on 2024-12-30 at 10:25

@modulux

Well, in SQL LIKE, it's basically the equivalent of * in regular expressions. Makes sense there.

=> More informations about this toot | More toots from amin@polymaths.social

Written by ben on 2024-12-30 at 10:34

@modulux This one always trips me up. It hardly ever matters, which means that when it does matter I’ve forgotten about it again. (Usually in date format strings, or printf etc.)

=> More informations about this toot | More toots from benjamineskola@hachyderm.io

Written by modulux on 2024-12-30 at 10:34

@benjamineskola Yes, I was piping to ts to get timestamps on the log, and of course I used a format string, and of course I did not escape it because... why is this even a thing?

=> More informations about this toot | More toots from modulux@node.isonomia.net

Written by ben on 2024-12-30 at 10:53

@modulux well, I suppose it’s necessary to have a way to include newlines in a cron job, which are otherwise slightly constrained shell scripts.

But I’m not sure if there would have been a better choice than %. \n is the obvious choice but maybe it has too high a chance of conflicting with an actual use of \n, whereas % is relatively rarely used? That’s just guessing though.

=> More informations about this toot | More toots from benjamineskola@hachyderm.io

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113741278833380429
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
427.344638 milliseconds
Gemini-to-HTML Time
2.160929 milliseconds

This content has been proxied by September (3851b).