Date: Apr 4, 2013 4:32 PM
Author: Nasser Abbasi
Subject: Re: Help with UNIX() command
On 4/4/2013 2:52 PM, John wrote:
>> But may be this helps
>> Execute operating system command and return output"
> [s,w]=unix('to3d -session e126 -prefx 4244_run_01 -epan -time:zt 28 104 1800 altplus ./s1037/*MRDC*')
> /bin/bash: to3d: command not found
> That is what I run and the error I get. Using system produces the same error.
>The problem is MATLAB is trying to run it through a bash shell, and its a
>command for a c-shell(csh). I need to know how to get MATLAB to execute
>the command in a c-shell. and ! will not work either for the exact same reason.
Matlab is not trying to do anything. Matlab knows nothing about c-shells
or bash or sh or DOS or anything of this stuff.
I am sure all what it does is an exec() somewhere and hands the new process created the
command you issued to run.
"The initial argument for these functions is the name of a file that is to be executed"
So you need to look at your own login process to see what default shell
gets invoked for it. Basically, if you can login to Linux and
type the above command from the terminal and it works, then you should be able to
do the same from Matlab using the system("command")
It looks like your linux login sets bash as the default shell, and the
PATH is not setup to find c-shell, or c-shell it not installed.
You have to look at the command itself first, make sure it works OK on