title: Is there a way to use repeated parts of command line just once?
body: <p>I need to use plural commands sequence frequently, like:</p>
  <pre><code>xelatex a-tex-file.tex &amp;&amp; xelatex a-tex-file.tex
  </code></pre>
  <p>to create a latex catalog. Or:</p>
  <pre><code>dot -Tpdf -o a-dot-file{.pdf,.dot} &amp;&amp; evince a-dot-file.pdf
  </code></pre>
  <p>to view a pdf file after being compiled immediately to check if I correctly modify the graph file described by dot language.
  And so on.</p>
  <p>To prevent clerical error I want to use repeated command line parts(such as filename) by any possible ways, a bit like:</p>
  <pre><code>xelatex a-tex-file.tex &amp;&amp; xelatex $2
  </code></pre>
  <p>and maybe</p>
  <pre><code>dot -Tpdf -o a-dot-file.pdf ${3%.*}.dot &amp;&amp; evince $3
  </code></pre>
  <p>Maybe set (positional) variables or make a script can get it but I hope it can change the environment as less as possible, and I don't think it is sensible to make scripts for every command permutation, or set/unset variable on every time.</p>
  <p>So is there any way to use repeated command line parts in just current command line more &quot;temporarily&quot; in various shells?</p>