0

What is the most elegant way to make this work?

prc_count=$(nproc --all)
factor=0.5
prc_count=$((prc_count*factor))

I tried with awk/echo and no success

Stat.Enthus
  • 101
  • 1
  • 1
    If you're just multiplying by a constant factor like 0.5, you could do $(( a * 5 / 10 )). Also, if you're going to say "I tried xyz and no success", it's better to show what exactly you tried and what exactly the problem was, it makes it easier to help you. – ilkkachu Jun 08 '22 at 12:20
  • Thanks, the idea that factor can be modified from 0.5 to 2.5 or 3 – Stat.Enthus Jun 08 '22 at 12:33

0 Answers0