I am trying to print the memory details . Total , Free and used memory using a shell script. This is my code -
printf "\nSystem Details\n"
printf "CPU $(cat /proc/cpuinfo | grep "model name" | head -1)"
printf "Total Memory:"
printf "$(awk '/^Mem/ {print $3}' <(free -m))"
But terminal doesn't display any memory details. It shows this error.
Memory:info.sh: command substitution: line 23: syntax error near unexpected token `('
info.sh: command substitution: line 23: `awk '/^Mem/ {print $3}' <(free -m))"'