Note that there are some explanatory texts on larger screens.

plurals
  1. POCommand arguments being interpreted as command file name
    primarykey
    data
    text
    <p>I'm trying to create a bash script that builds up a command to execute (that includes arguments). The name of the command executable is ms (which lives in the ms directory) and it takes a bunch of parameters that I compute and store in a string. When it comes time to execute the command, I try:</p> <pre><code>GENETREES=$(../ms/${x:1}) </code></pre> <p>but am getting the error message:</p> <pre><code>./simulate.sh: line 21: ../ms/ms 6 1 -T -I 6 1 1 1 1 1 1 -ej 0.059851352500000010170566611122922040522098541259765625 1 4 -es 0.059851352500000010170566611122922040522098541259765625 4 0.3457841801761454281205487859551794826984405517578125 -ej 0.059851352500000010170566611122922040522098541259765625 2 3 -es 0.059851352500000010170566611122922040522098541259765625 3 0.54870128110803395582451003065216355025768280029296875 -ej 0.0897770262499999471828004971030168235301971435546875 7 9 -es 0.089777026250000002693951728360843844711780548095703125 3 0.8097582153199012200417428175569511950016021728515625 -ej 0.119702699999999995217336845598765648901462554931640625 3 4 -ej 0.125827642499999947656164067666395567357540130615234375 9 10 -es 0.1258276425000000031673152989242225885391235351562500 4 0.28069295861466903030390085405088029801845550537109375 -ej 0.13195258499999995560614252099185250699520111083984375 8 10 -ej 0.1817980399999999663318561715641408227384090423583984375 6 5 -ej 0.2525933399999999717788767839010688476264476776123046875 10 4 -ej 0.41145434999999996872332985731191001832485198974609375 4 5 : File name too long </code></pre> <p>I think bash thinks that I intended all those command parameters to be a part of the executable name. But this is not my intent.</p> <p>What am I doing wrong?</p> <p>Thanks.</p> <p><em>Update - More info requested on how x is constructed</em></p> <pre><code>MSOUT=$(java -jar ./NetworkSearchGen.jar ms $3 $TRUENETWORK $4) OIFS=$IFS IFS='}' first="true" for x in $MSOUT do if [ $first = "true" ]; then echo "$x" else GENETREES=$(../ms/${x:1}) fi first="false" done </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload