Hi,
I have Windows Subsystem for Linux (WSL).
In a Matlab script, I want to run some bash commands and scripts, so I do:
But doesn't work when trying to export an environment variable:
system('wsl export FREESURFER_HOME=\"~/freesurfer\"')
system('wsl echo ${FREESURFER_HOME}')
This returns 0 for both lines (no error) but yet the variable FREESURFER_HOME is not exported.
I also tried to use the setenv command but this adds the variable to the windows environment, not the WSL one:
setenv('FREESURFER_HOME', "~/freesurfer");
system('wsl ${FREESURFER_HOME}')
system('echo %FREESURFER_HOME%')
Any idea on how to export an environment variable in the WSL environment ?
Thanks