
On Fri, 26 Mar 2021 17:23:31 +1300, Matthew Skiffington wrote:
https://askubuntu.com/questions/978977/windows-subsystem-for-linux-display-l...
Quite an entertaining mix of `...` and $(...) -- cobbled together by someone who didn’t realize that the latter is a better way of (re)writing the former? And the overuse of elaborate manipulations of command output, without realizing that many of those commands offer simpler ways of producing just the output you want? For user=$(echo "$USER") try user=$(whoami) For arch=`lsb_release -a 2>&1 | awk '{ print $2 " " $3 " " $4}' | head -3 | tail -1` why not just do arch=$(lsb_release -ds) These ones size=`df -H | awk '{ print $2}' | head -2 | tail -1 | tr -d '\r '` free=`df -H | awk '{ print $4 }' | head -2 | tail -1 | tr -d '\r '` are a bit baffling. Presumably they are trying to check usage on the root volume, rather than just the first thing that appears in the volume listing? Try these size=$(df -H --output=size / | tail -1) free=$(df -H --output=avail / | tail -1) There’s more, but you get the idea ...