# Problem with shell in Windows

**URL:** <https://discourse.julialang.org/t/problem-with-shell-in-windows/42540>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [July 5, 2020, 12:36am UTC](https://discourse.julialang.org/t/problem-with-shell-in-windows/42540 "2020-07-05T00:36:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isaiah](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Isaiah](https://discourse.julialang.org/u/Isaiah)\
**Post date:** [July 5, 2020, 12:36am UTC](https://discourse.julialang.org/t/problem-with-shell-in-windows/42540/1 "2020-07-05T00:36:10Z")

</div>

Hi, Julia newbie here.

In [https://github.com/JuliaAcademy/DataScience](https://github.com/JuliaAcademy/DataScience), there are the lines:

```julia
using BenchmarkTools

using DataFrames

using DelimitedFiles

using CSV

using XLSX

println("I'm excited to learn Julia")

P = download("https://raw.githubusercontent.com/nassarhuda/easy_data/master/programming_languages.csv",

"programminglanguages.csv")

;wget "https://raw.githubusercontent.com/nassarhuda/easy_data/master/programming_languages.csv"

;head programminglanguages.csv

```

In VSC and Julia REPL, the lines above run fine up to the shell commands.

I am using Windows 10 and Julia 1.4.

“;” opens the shell fine, however

```julia
wget "https://raw.githubusercontent.com/nassarhuda/easy_data/master/programming_languages.csv"

head programminglanguages.csv

echo hello

```

all return similar errors

```julia
shell> echo hello

ERROR: IOError: could not spawn `echo hello`: no such file or directory (ENOENT)

Stacktrace:

 [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at .\process.jl:99

 [2] #550 at .\process.jl:112 [inlined]

 [3] setup_stdios(::Base.var"#550#551"{Cmd}, ::Array{Any,1}) at .\process.jl:196

 [4] _spawn at .\process.jl:111 [inlined]

 [5] run(::Cmd; wait::Bool) at .\process.jl:439

 [6] run at .\process.jl:438 [inlined]

 [7] repl_cmd(::Cmd, ::REPL.Terminals.TTYTerminal) at .\client.jl:69

 [8] top-level scope at none:0

 [9] eval(::Module, ::Any) at .\boot.jl:331

 [10] eval_user_input(::Any, ::REPL.REPLBackend) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:86

 [11] run_backend(::REPL.REPLBackend) at C:\Users\Isaia\.julia\packages\Revise\BqeJF\src\Revise.jl:1184

 [12] top-level scope at none:0

```

`julia> ENV["PATH"]`  
returns my usual path statement.

All three commands work in WSL.

Both dir and ls give a similar error

Wondering how to get these shell commands to work?

---

<div class="post-metadata">

**Author:** ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)\
**Post date:** [July 5, 2020, 2:03am UTC](https://discourse.julialang.org/t/problem-with-shell-in-windows/42540/2 "2020-07-05T02:03:06Z")

</div>

Welcome to the Julia Community! See [https://github.com/JuliaLang/julia/issues/23597](https://github.com/JuliaLang/julia/issues/23597)

---

<div class="post-metadata">

**Author:** ![Isaiah](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Isaiah](https://discourse.julialang.org/u/Isaiah)\
**Post date:** [July 6, 2020, 3:28am UTC](https://discourse.julialang.org/t/problem-with-shell-in-windows/42540/3 "2020-07-06T03:28:50Z")

</div>

Thanks @Mattriks! My notes on where you directed me:

For windows commands:

cmd /c command # /C Carries out the command then terminates

eg cmd /c dir

eg cmd /c START notepad.exe

list for cmd:

ASSOC, BREAK, CALL, CD/CHDIR, CLS, COLOR, COPY, DATE, DEL, DIR, DPATH,

ECHO, ENDLOCAL, ERASE, EXIT, FOR, FTYPE, GOTO, IF, KEYS, MD/MKDIR,

MKLINK, MOVE, PATH, PAUSE, POPD, PROMPT, PUSHD, REM,

REN/RENAME, RD/RMDIR, SET, SETLOCAL, SHIFT, START, TIME, TITLE, TYPE,

VER, VERIFY, VOL

For Linux commands:

Add to path the Code.exe and julia.exe paths (I’m using VSC)  
(in the windows search box, type path, select “edit the environment variables,”  
Click the “environment variables” button. In “system variables” pane, double click “path”, click “new” button. Restart)

Launch git bash  
$ Code  
Or $ Julia

Or add git-bash.exe path to the path environment variable.  
In cmd, git-bash -c Code,  
Or create a short cut with target: “C:\Program Files\Git\git-bash.exe” -c Code  
(Keep the git-bash window open)

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [July 6, 2020, 3:58am UTC](https://discourse.julialang.org/t/problem-with-shell-in-windows/42540/4 "2020-07-06T03:58:59Z")

</div>

> [@Using Julia on Git bash](https://discourse.julialang.org/t/using-julia-on-git-bash/24413/7):
>
> Sorry to hear that. This definitely works for me: I put the following into start.bat start "" "%PROGRAMFILES%\Git\bin\sh.exe" --login -i -c "exec julia" I make sure that when I open cmd and type "%PROGRAMFILES%\Git\bin\sh.exe" I get the bash. Then, in bash I must be able to type julia and get the Julia prompt. Under these conditions things work. What happens on your system? Edit: The paths need to be set for the above to work. On my system:

---

<div class="post-metadata">

**Author:** ![Isaiah](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@Isaiah](https://discourse.julialang.org/u/Isaiah)\
**Post date:** [July 6, 2020, 9:34am UTC](https://discourse.julialang.org/t/problem-with-shell-in-windows/42540/5 "2020-07-06T09:34:58Z")

</div>

> [@Using Julia on Git bash](https://discourse.julialang.org/t/using-julia-on-git-bash/24413/7):
>
> start “” “%PROGRAMFILES%\Git\bin\sh.exe” --login -i -c “exec julia”

Thanks @ [PetrKryslUCSD](https://discourse.julialang.org/t/problem-with-shell-in-windows/42540/4)! A shortcut with C:\WINDOWS\system32\cmd.exe /c start “” “%PROGRAMFILES%\Git\bin\sh.exe” --login -i -c “exec julia” as the target worked too
