Section 17.1.1.1. of the documentation states:
If shell is True, the specified command will be executed through the shell. This can be useful if you are using Python primarily for the enhanced control flow it offers over most system shells and still want convenient access to other shell features such as shell pipes, filename wildcards, environment variable expansion, and expansion of ~ to a user’s home directory.
However, on cygwin, output from bash isn't the same as from Python's subprocess, viz:
Bash:
$ ls -ls ~rbarakx
total 0
0 drwxr-xr-x 1 Administrator None 0 Aug 21 17:54 bash
0 drwxr-xr-x 1 Administrator None 0 Jul 11 09:11 python
Python:
>>> subprocess.call(["ls","-ls","~rbarakx"],shell=True)
RCS mecha.py print_unicode.py req.py requests_results.html selen.py
0
It looks as if subprocess.call is executing just ls.
Can you suggest why?
My Environment:
Python: Python 2.7.3 (default, Dec 18 2012, 13:50:09) [GCC 4.5.3] on
cygwin
cygwin: CYGWIN_NT-6.1-WOW64 ... 1.7.22(0.268/5/3) ... i686
Cygwin
windows: Windows 7 Ultimate