Skip to content

Commit

Permalink
Update get total core for HERC_CORES
Browse files Browse the repository at this point in the history
  • Loading branch information
vietlubu committed Mar 12, 2024
1 parent b836b93 commit 8edd893
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sysinfogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ case $HERC_PLATFORM in
HWDATA="$( system_profiler SPHardwareDataType )"
HWDATA_CPU="$( echo "$HWDATA" | grep "Processor Name:" | cut -d: -f2- )"
HWDATA_CPUSPEED="$( cleanstring "$( echo "$HWDATA" | grep "Processor Speed:" | cut -d: -f2- )" )"
HERC_CORES="$( echo "$HWDATA" | grep "Total Number of Cores:" | cut -d: -f2- )"
HERC_CORES="$( echo "$HWDATA" | grep "Total Number of Cores:" | cut -d: -f2- | sed -E 's/ *([0-9]+).*/\1/')"
HERC_CPU="${HWDATA_CPU} (${HWDATA_CPUSPEED})"
fi
;;
Expand Down Expand Up @@ -238,7 +238,7 @@ cat >> "$OUTFILE" << EOF
#define SYSINFO_CPU "$( cleanstring "${HERC_CPU}" )"
// CPU Cores (Platform-dependent)
#define SYSINFO_CPUCORES ( "$( cleanstring "${HERC_CORES}" )" )
#define SYSINFO_CPUCORES ( $( cleanstring "${HERC_CORES}" ) )
EOF
[ $? -eq 0 ] || do_fail
Expand Down

0 comments on commit 8edd893

Please sign in to comment.