How can i run the bash shell script in matlab
170 views (last 30 days)
Show older comments
Farik John on 29 Jan 2016
Answered: DanielFromIllinois on 14 Mar 2022
I have the bash file in where there is something like below.
wget http://www.vlfeat.org/sandbox-matconvnet/models/imagenet-vgg-verydeep-16.mat \
How can i run this script file?
Geoff Hayes on 29 Jan 2016
Farik - use system to run your script. See http://www.mathworks.com/matlabcentral/answers/157199-run-a-bash-script-from-matlab for an example.
PRAVALLIKA PEDDAMALLU on 27 Jan 2022
Hi @Farik John, I'm trying to run shell script from matlab in windows. When I use system('D:\MyProject\download.sh'); command, it is directing to the shell script file in notepad++ rather than running the commands.
I tried using "system('c:\cygwin64\bin\bash "d:\MyProject\download.sh"');" but this is throwing error saying "Not a directory". Please let me know how can we run shell script from matlab.
I value your input. Thanks in advance.
DanielFromIllinois on 14 Mar 2022
If you're running this from Windows (not mac or linux) I got this to work by doing:
The above assumes that Something.sh is in your current directory within MATLAB. You could provide an absolute path like:
Find more on Install Products in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!