Need help in calling the below mentioned awk script using Python subprocess module? .I need to get this working as our monitoring tool requires this. I am a novice in python and I have tried the below and it hasn't helped.
>>> print subprocess.check_output(["awk '!/bind|swap|shm/ && $1 !~/#|^$/ {system("if [[ -n $(findmnt -m " $2 ") ]]; then echo Mount " $2 " is mounted.;else echo Mount " $2 " is NOT mounted.;fi")}' /etc/fstab"], shell=True, universal_newlines=True)
File "<stdin>", line 1
print subprocess.check_output(["awk '!/bind|swap|shm/ && $1 !~/#|^$/ {system("if [[ -n $(findmnt -m " $2 ") ]]; then echo Mount " $2 " is mounted.;else echo Mount " $2 " is NOT mounted.;fi")}' /etc/fstab"], shell=True, universal_newlines=True)
^
SyntaxError: invalid syntax
>>>