title: awk: runtime error - Compatility between zsh config on MacOS Catalina and zsh config on Debian Buster
body: <p>I have a zsh config on MacOS Catalina which works well. No, I would like to get the same but for Debian 10 Buster.</p>
  
  <p>The issue occurs in the using of function for PROMPT that displays pink slashes that separate the PATH current working where directories are in blue.</p>
  
  <p>On MacOS, I do it like this (into my .zshrc) :</p>
  
  <pre><code># Path with colorized forward slash
  slash_color() {
  dirs | awk -F "/" '{ blue="%{\033[38;5;75m%}"; \
                       pink="%{\033[38;5;206m%}"; \
                       for (i=1; i&lt;NF; i++) \
                        printf blue $i pink "/"; \
                       printf blue $NF pink; \
                     }';
  }
  
  # Prompt final
  PROMPT=$'%F{13}|%F{green}%n@%F{cyan}%m%F{13}|%f%T%F{13}|$(slash_color)%F{13}|%F{7} '
  </code></pre>
  
  <p>The result looks like for PROMPT :</p>
  
  <p><a href="https://i.stack.imgur.com/Z9H4Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z9H4Z.png" alt="zsh prompt for MacOS Catalina "></a></p>
  
  <p>Now, on Debian Buster, I have copied the ~/.zshrc from MacOS Catalina.</p>
  
  <p>and <strong>when PROMPT is displayed, the PATH of current working directory is not displayed (empty)</strong> and I get the following error :</p>
  
  <pre><code>awk: run time error: not enough arguments passed to printf("%{%}~%{%}/")
      FILENAME="-" FNR=1 NR=1
  </code></pre>
  
  <p>I don't know why I have this error on Debian and not on MacOS. I suspect this is due to a difference on the working of my <code>slash_color()</code> function but I don't understand the origin.</p>
  
  <p>It seems that a variable is missing in Debian version for <code>awk</code>, but I can't see which one.</p>