I'm trying to make a program that will monitor my CPU cores over time, using a little shell as I'm trying to learn it.
- I want to determine the # of cores
- I then want to create a column for each core, so that I can add the data to each core when I collect it.
The csv file would create the columns like: Core1, Core2, Core3, Core4, Core5, Core6, Core7, Core8
#!/bin/sh
cores=grep -c ^processor /proc/cpuinfo #Shows I have 8 cores
touch core_monitor.csv #make csv file
echo core{1..cores}, >> core_monitor.csv
#This echo doesn't work. it prints the string literal `core{1..cores},`