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
@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
@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
@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
@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
@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
@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 This content has been proxied by September (3851b).Proxy Information
text/gemini