Run Something.sh file from matlab

67 visualizaciones (últimos 30 días)
Rajitha Dehigaspitiya
Rajitha Dehigaspitiya el 2 de Mayo de 2016
Respondida: DanielFromIllinois el 14 de Mzo. de 2022
I want to run .sh file from the matlab . I have tried following way but its giving the permission denied error.
system('/home/scripts/Something.sh')
/bin/bash: /home/scripts/Something.sh: Permission denied
  1 comentario
Jan
Jan el 2 de Mayo de 2016
And can you run it from the shell directly? Who is he owner and is the executable flag activated?

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 2 de Mayo de 2016
system('sh /home/scripts/Something.sh')
  2 comentarios
Naveen Jacob
Naveen Jacob el 5 de Mayo de 2020
Thanks it worked !!

Iniciar sesión para comentar.


DanielFromIllinois
DanielFromIllinois el 14 de Mzo. de 2022
If you're running this from Windows (not mac or linux) I got this to work by doing:
system('C:\Apps\Git\git-bash.exe Something.sh')
The above assumes that Something.sh is in your current directory within MATLAB. You could provide an absolute path like:
system('C:\Apps\Git\git-bash.exe C:\Users\UserName\home\scripts\Something.sh')

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by