JuliaLang/julia — pull request #3472 by vtjnash (2013-06-20 16:54:46+00:00)
Title: fix #3397 -- support for shell commands from readline-repl via ? prefix

```julia
julia> pwd()
"/Users/jameson/Documents/no-backup/julia"

julia> ?cd

julia> ?pwd
/Users/jameson

julia> ?ls -la
total 2688
drwxr-xr-x+ 119 jameson staff 4046 Jun 20 12:30 .
drwxr-xr-x 5 root admin 170 Jan 4 20:31 ..
-rw------- 1 jameson staff 3 Aug 28 2011 .CFUserTextEncoding
-rw-r--r--@ 1 jameson staff 15364 May 26 02:00 .DS_Store

julia> ?cd C:\Users\jameson
ERROR: chdir C:\Users\jameson: No such file or directory
in systemerror at error.jl:38
in cd at file.jl:14

julia> ?echo a\
b\
c\
d
a
b
c
d

julia> ?ls $(Pkg.dir())
ArgParse DataFrames Gaston

julia> ?cd $(Pkg.dir("Winston"))

julia> ?pwd
/Users/jameson/.julia/Winston

julia> ?cd "/"
ERROR: chdir "/": No such file or directory
in systemerror at error.jl:38
in cd at file.jl:14

julia> ?cd /

julia> ?cd ~
ERROR: chdir ~: No such file or directory
in systemerror at error.jl:38
in cd at file.jl:14

julia> ?ls ~
ls: ~: No such file or directory
ERROR: failed process: Process(`ls ~`, ProcessExited(1)) [1]
in error at error.jl:22
in pipeline_error at process.jl:434
in run at process.jl:418
```

This parses readline-repl lines starting with `?` as calls to the shell (actually, the run function). It detects calls to `cd` and instead calls `cd()`. Note that the implementation of `cd` means that it will behave slightly differently in the presence of $ interpolation.