I have written a small python script but bash won't execute it:
#!/usr/bin/python
'''
Created on Dec 19, 2014
'''
import subprocess
if __name__ == '__main__':
p = subprocess.Popen('df -h', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
out,err = p.communicate()
for o in out.splitlines():
if('rootfs' in o):
print o.split()[3]
When I run ./te.py
, bash gives me an error:
-bash: ./te.py: /usr/bin/python^M: bad interpreter: No such file or directory
What's the problem?