github.com/xiaq/elvish@v0.12.0/website/tty/control-structures.html (about)

     1  ~&gt; <span class="sgr-32">if</span><span class="sgr-"> </span><span class="sgr-35">$true</span><span class="sgr-"> </span><span class="sgr-1">{</span><span class="sgr-"> </span><span class="sgr-32">echo</span><span class="sgr-"> good </span><span class="sgr-1">}</span><span class="sgr-"> </span><span class="sgr-33">else</span><span class="sgr-"> </span><span class="sgr-1">{</span><span class="sgr-"> </span><span class="sgr-32">echo</span><span class="sgr-"> bad </span><span class="sgr-1">}</span>               
     2  good
     3  ~&gt; <span class="sgr-32">for</span><span class="sgr-"> </span><span class="sgr-35">x</span><span class="sgr-"> </span><span class="sgr-1">[</span><span class="sgr-">lorem ipsum</span><span class="sgr-1">]</span><span class="sgr-"> </span><span class="sgr-1">{</span>
     4       <span class="sgr-32">echo</span><span class="sgr-"> </span><span class="sgr-35">$x</span><span class="sgr-">.pdf</span>
     5     <span class="sgr-1">}</span>
     6  lorem.pdf
     7  ipsum.pdf
     8  ~&gt; <span class="sgr-32">try</span><span class="sgr-"> </span><span class="sgr-1">{</span>
     9       <span class="sgr-32">fail</span><span class="sgr-"> </span><span class="sgr-33">&#39;bad error&#39;</span>
    10     <span class="sgr-1">}</span><span class="sgr-"> </span><span class="sgr-33">except</span><span class="sgr-"> </span><span class="sgr-35">e</span><span class="sgr-"> </span><span class="sgr-1">{</span>
    11       <span class="sgr-32">echo</span><span class="sgr-"> error </span><span class="sgr-35">$e</span>
    12     <span class="sgr-1">}</span><span class="sgr-"> </span><span class="sgr-33">else</span><span class="sgr-"> </span><span class="sgr-1">{</span>
    13       <span class="sgr-32">echo</span><span class="sgr-"> ok</span>
    14     <span class="sgr-1">}</span>
    15  error ?(fail 'bad error')