KittyKatt / screenFetch

Fetches system/theme information in terminal for Linux desktop screenshots.
GNU General Public License v3.0
3.82k stars 453 forks source link

[Bug] screenfetch print error message when LANG=zh_CN.UTF-8 #727

Open hzhangxyz opened 3 years ago

hzhangxyz commented 3 years ago

My screenfetch output is

/usr/bin/screenfetch:行1802: 2767982592-:语法错误: 需要操作数 (错误符号是 "-")
...

This is because screenfetch get the result from free -b, while when LANG=zh_CN.UTF-8, the result cannot be split by space. So later awk give the wrong result

I have create an issue for free here


free -b output:

               total        used        free      shared  buff/cache   available
内存:25048236032  2776240128 12871360512  1027239936  9400635392 20846157824
交换:          0           0           0

screenshot problematic code

mem=$(free -b | awk 'NR==2{print $2"-"$7}')