Home > OS >  Linux bash/dash problem, a great god, please help
Linux bash/dash problem, a great god, please help

Time:09-28

#!/bin/sh
TotalCores=` lscpu | grep "On - line CPU (s)" | the cut - c 26-28 `
DCTCORES="$(seq -s', '0 ${(totalCores + 1)/2})"
DCTCORES_SPDELIM=` echo $DCTCORES | sed "s/,//g" `

After the operation to quote the following wrong, how to solve,,,,
Line 3: ${(totalCores + 1)/2} : bad substitution

CodePudding user response:

Curly braces to brackets
DCTCORES="$(seq -s', '0 $(totalCores + 1)/2)"
  • Related