title: Windows Subsystem for Linux - Passing arguments to commands on start
body: <p>I am currently working on a setup to utilize wsl for my development needs. In order to do that I created wsl so that it works with systemd to enable the use of microk8s and other services that depend on systemd.</p>
  <p>Now this brings me to a problem. I want to be able to start wsl and navigate to the directory I am currently in. Now</p>
  <pre class="lang-sh prettyprint-override"><code>wsl /bin/bash
  </code></pre>
  <p>would just do that. Unfortunately bash will then bypass my /etc/profile.d scripts which will result in my init process being the one wsl set up instead of systemd.</p>
  <p>Now I can easily pass an argument to any shell script inside of wsl as you would expect</p>
  <p><strong>example.sh</strong></p>
  <pre class="lang-sh prettyprint-override"><code>echo &quot;Your argument is $1&quot;
  </code></pre>
  <pre class="lang-sh prettyprint-override"><code>example.sh Hello World
  
  # Output
  # Your argument is Hello
  </code></pre>
  <p>But for some reason I was not able to do the same thing from outside</p>
  <pre class="lang-sh prettyprint-override"><code>wsl /path/example.sh Hello
  bash -c /paht/example.sh
  </code></pre>
  <p>all of those calls will not result in $1 containing anything. Any ideas how i could accomplish that?</p>