当前位置:  开发笔记 > 开发工具 > 正文

在Julia中运行Windows shell命令

如何解决《在Julia中运行Windowsshell命令》经验,为你挑选了1个好方法。

据说在朱莉娅,我可以通过首先击中来运行shell命令;.但我的Windows 7机器上没有运气.这是我第一次dir在shell中运行的示例,然后尝试在Julia中执行相同的操作:

C:\Users\Public>dir
 Volume in drive C is OS
 Volume Serial Number is A4A2-4168

 Directory of C:\Users\Public

01/30/2016  03:31 AM              .
01/30/2016  03:31 AM              ..
07/13/2009  09:08 PM              Documents
07/13/2009  08:54 PM              Downloads
01/02/2017  10:56 AM              Music
01/16/2016  02:53 PM           262,144 NTUSER.DAT
07/13/2009  08:54 PM              Pictures
11/20/2010  11:16 PM              Recorded TV
01/05/2016  06:06 AM              Roaming
07/13/2009  08:54 PM              Videos
               1 File(s)        262,144 bytes
               9 Dir(s)  850,167,861,248 bytes free

C:\Users\Public>julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-w64-mingw32

shell> dir
ERROR: could not spawn `dir`: no such file or directory (ENOENT)
 in _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at .\process.jl:3
21
 in #414 at .\process.jl:478 [inlined]
 in setup_stdio(::Base.##414#415{Cmd,Ptr{Void},Base.Process}, ::Tuple{RawFD,RawFD,RawFD}) at .\process.jl:466
 in #spawn#413(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}, ::Bool, ::Bool) at .\pr
ocess.jl:477
 in run(::Cmd) at .\process.jl:591
 in repl_cmd(::Cmd, ::Base.Terminals.TTYTerminal) at .\client.jl:91

julia>

我已经尝试过其他命令,并且cd工作,但cls没有.这里出了什么问题?



1> Yly..:

这有效:

shell>cmd /c dir

推荐阅读
勤奋的瞌睡猪_715
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有