# How to configure which port workers listen

**URL:** https://discourse.julialang.org/t/how-to-configure-which-port-workers-listen/46759
**Category:** Julia at Scale
**Created:** [September 17, 2020, 8:16am UTC](https://discourse.julialang.org/t/how-to-configure-which-port-workers-listen/46759 "2020-09-17T08:16:10Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![DrChainsaw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drchainsaw/32/8497_2.png) [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)
#### Post date: [September 24, 2020, 8:36am UTC](https://discourse.julialang.org/t/how-to-configure-which-port-workers-listen/46759/6 "2020-09-24T08:36:54Z")

</div>

I managed to work around the issue by using perl to compute the port number instead of bash. For some reason any permutation of `bash -c 'echo <expr>'` resulted in unwanted single quotes in the final expression and for some reason this does not happen when using `perl -le 'print <expr>'`

Here is the final expression I ended up using:

```julia
exeflags=`--bind-to \`hostname -i\`:\`perl -le 'print 6000+(10*$ENV{"LSB_JOBID"}+$ENV{"LSB_JOBINDEX"})%1000' \`

```

---

_[View the full topic](https://discourse.julialang.org/t/how-to-configure-which-port-workers-listen/46759)._
