I am having a script file for disk usage and I am getting the following errors:
$ DISKTOTAL=$(df -m |column -t |awk '{print $2}' |tail -n +2|awk '{Total=Total+$1} END{print Total}')
df: '/var/lib/ureadahead/debugfs/tracing': No such file or directory
$ DISKUSAGE=$(df -m |column -t |awk '{print $3}' |tail -n +2|awk '{Total=Total+$1} END{print Total}')
df: '/var/lib/ureadahead/debugfs/tracing': No such file or directory
$ DISKUSAGEPERCENT=$(echo "$DISKUSAGE / $DISKTOTAL * 100.0"|bc -l)
-bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: Permission denied
It also gives this error while executing the script:
-bash: line 7: bc: command not found
Why is it not recognizing the bc
command in my DISKUSAGEPERCENT
command?
bc
is installed by default since I remember. – pLumo Nov 23 '22 at 14:27