Windows Bash/WSL System Calls
21 次查看(过去 30 天)
显示 更早的评论
Hello,
Windows 10 has a bash environment based on Trusty Ubuntu (14.04). In the windows command prompt, you can call bash commands like this:
bash -c "lsb_release -a"
I expected that a Matlab
system('bash -c "lsb_release -a"')
or
dos('bash -c "lsb_release -a"')
call or ! bash -c "lsb_release -a" would show the same behavior. However, it does not. I receive an Eans=-1 return. Why is this? Is there a way around it? Running r2012a.
0 个评论
回答(2 个)
David Crist
2017-9-9
编辑:David Crist
2017-9-9
This is a problem for me as well. The problem with relying on
!bash -c ls /a/path/variable/
Is that you can't use the ! syntax with variables. I'm surprised there isn't a proper fix or response to this.
Also, the below is invalid matlab:
[status,output] = !bash -c ls
0 个评论
Mahsa Ghasemi
2017-7-10
Hi,
One way of calling bash inside MATLAB on a Windows 10 platform is to use "!", e.g.,
!bash bashScript.sh
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!