Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
1) Lots of undefined behavior. It may work.... or kill you. 2) What's with the separator? Apparently you've used a NUL (undefined behavior) at the start as your separator. This may be accidental, as it comes from j being initialized to 1, or more if you give extra parameters. With 64 parameters, there is no output at all. 3) I tried the bonus version with 58 characters before the @. Tries to make 2^58 processes. Drove the machine into the ground, and fork() can fail.
If I had known I was going to shorten it by 1/3... :-) xxx& instead of (xxx) works, unless you try two invocations ( f 12:30; f 16:16 ) and expect to be able to reasonably read the results. I note it but do not recommend it.
While i does have to be initialized, it does not have to be 0. blank works. It turns out that the $(( )) construct treats empty variables as 0. If you want, you can make it a one liner by using a space or ; instead of newline between the i= and for. Doesn't save bytes, but can be cute. Another twist. If you enclose the line in parentheses, the use of the variable is in a subprocess, so doesn't survive. So if we can assume i (or some variable) to be uninitialized, it won't be afterwards either. And (xxx) is one byte shorter than i=;xxx
I decided to see what I could do with GNU date... Instead of "today", one can write "jan1" or "Mon", or even just the letter for ones local timezone (which for TIO, would be "Z"). Alas, if you put nothing there, the "+2hour" becomes the timezone.
Two more, if you've done the previous. The escaped space before "hour" is needed when writing "$d hour" but not if writing "$((i++))hour" In the former case, writing "$dhour" became a 5 character variable reference.
A weird one: eliminate c, make d iterate over the names, set "i=" before the loop, use $d instead of ${c[d]} and $((i++)) instead of $d. seems to save another 7 characters. If you are willing to trust that i is undefined, you can save 3 more by not initializing it at all.
Another big one: Since none of the city names include a %, you can put the ${c[d]} between the + and the %R, and eliminate the printf altogether. It think that brings it down to 90.
c=(Accra Lagos Rome Kyiv Dubai) saves ten bytes. Shells only need quotes if something is special. So you can save five more by remove all the " and ' on the second line, and putting a \ before the space in the -d option. Save one more by removing the space between the -d and its parameter. (101)