Run linux command in background from matlab

 Akzeptierte Antwort

Shivam
Shivam am 9 Jul. 2023

0 Stimmen

Hi Jay, for running linux command in background from matlab, you can use system("your_command &") , & after the command ensure that's the command runs on background.

3 Kommentare

An oddity of system() is that using the & this way is defined to be handled by system() itself, rather than just being passed as a command to the shell
Jay Shewale
Jay Shewale am 9 Jul. 2023
Bearbeitet: Jay Shewale am 9 Jul. 2023
Thank you so much
getenv('SHELL')
ans = '/bin/bash'
system('echo $0')
/bin/bash
ans = 0
So at least on MATLAB Online, any command you send to system() is processed as a bash command, and can use full syntax for I/O redirection and any multiple-process support.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by