I am new to shell scripting and trying to make a few small scripts. I got stuck when i tried to write if condition. In the code below i am trying to get the $5 value from df
Assuming you're using GNU tools, you can narrow the df output to just what you need:
df
pct=$( df --output=pcent / | grep -o '[[:digit:]]\+' ) if [[ $pct -gt 60 ]]; then ...