Home > front end >  How to write a bash script that runs a customized program?
How to write a bash script that runs a customized program?

Time:07-02

Here is an example for my customized program which is executed as:

./TestVariance.exe 2 100 10 .9

I want to write a bash script that runs it several times while changing the second argument each time. After searching some answers on SO, I come up with a script like

#!/bin/bash
let d=2
let s=10
let q=9/10
for i in 'seq 100 100 1000'
do 
    ./TestVariance.exe $d $i $s $q;
done

But it seems that the script only call TestVariance.exe without passing any arguments. I wonder what's wrong with my script?

BTW, is there any advice for vscode extensions on bash script?

CodePudding user response:

It should be

`seq 100 100 1000`

'seq 100 100 1000' is literal.

  •  Tags:  
  • bash
  • Related