[scilab-Users] "unix" or "unix_g" ... use + portability

Antoine Monmayrant antoine.monmayrant at laas.fr
Fri Jun 8 08:52:23 CEST 2012


Le 07/06/12 13:37, paul.carrico at free.fr a écrit :
> Dear Antoine,
>
> input, fin and stop are specific words for the solveur (bacon is for the pre-processing):
> - input ->  read the input file
> - fin and stop ->  record and close the pre-process module
>
> It works fine under Windows os (it was developped for some years) using cmd if I'm right ... the goal is to do the same under linux (FEA server)
My point was that the sh shell on unix does not behave like cmd in 
Windows and that the command string you pass to the shell can be 
interpreted differently by sh.
In particular, things like '*' '?', ... can be expanded by the shell if 
you don't specify that no expansion should be performed.
If you can show a real example of the string "commandline_BACON", we 
might be able to spot the problem.
Again, did you try to call directyl the solver, that is to copy paste 
the content of "commandline_BACON" in a terminal to see what happens?
If it works when calling directly, it can be a problem of environment: 
the shell that is called by scilab might not have the same environment 
then the one you get when opening a terminal.

Antoine
>
>
>
> Somebody advices me to have a look in the "Standard input" stdin field ...
>
> Paul
>
>
>
>
>
>
>
>
>
>
> ----- Mail original -----
> De: "Antoine Monmayrant"<antoine.monmayrant at laas.fr>
> À: users at lists.scilab.org
> Envoyé: Jeudi 7 Juin 2012 11:50:47
> Objet: Re: [scilab-Users] "unix" or "unix_g" ... use + portability
>
> On 07/06/2012 09:15, paul.carrico at free.fr wrote:
>> Dear All,
>>
>> AS ever spoken herebellow, I'm working on the portability from Windows OS to Linux oS including bash instructions ....
>>
>>
>> Original code under Windows (works fine):
>> commandline_BACON = "( ECHO ;INPUT """ + INPUT_FILE_NAME + ".dat""&   ECHO ;.FIN&   ECHO;.STOP ) | " + samcef_path + "\Bacon NOM=" + INPUT_FILE_NAME +" SAM_PREFIX=SAM_TMPDIR=banque=" + INPUT_FILE_NAME + ".dat "
>> [rep,stat,err]=unix_g( );
>>
>>
>> Nota :
>> - INPUT + .FIN + .STOP are specific keywords of the solver ... and they lead to error with sh
>> - I'm not "bash" skilled so I've not found the problem
>> - I've ever tested both unix_g and unix scilab keywords ...
>>
>> Any advice or any doc on how to avoid this trouble ?
>>
>> thanks in advance
>>
>> Paul
>>
>>
>>
>>
>>
>> ----- Mail original -----
>> De: "paul carrico"<paul.carrico at free.fr>
>> À: users at lists.scilab.org
>> Envoyé: Mercredi 6 Juin 2012 22:47:12
>> Objet: [scilab-Users] "unix" or "unix_g" ... use
>>
>> Hi all,
>>
>> I'm currently rewriting programs (initially developped under Windows OS) on Linux OS ... and I've some troubles ...
>>
>> under Linux, why the following code does not work : unix('firefox') ... 'firefox is just for the example'
>>
>>
>> from the help, 'unix' is equivalent to 'sh' ... on a terminal 'sh firefox' or simply 'firefox' works ????
>>
>> It's probably a stupid question, but I've many "command lines" to lauch from scilab ...
>>
>> Thanks
>>
>> Paul
>>
>> --
>> To unsubscribe from this mailing-list, please send an empty mail to
>> users-unsubscribe at lists.scilab.org
>> To check the archives of this mailing list, see
>> http://mailinglists.scilab.org/
>>
>> --
>> To unsubscribe from this mailing-list, please send an empty mail to
>> users-unsubscribe at lists.scilab.org
>> To check the archives of this mailing list, see
>> http://mailinglists.scilab.org/
>>
>>
> Hi Paul,
>
> Can you give us an example of what commandline_BACON really looks like
> once all the variables are evaluated (ie replaced by the string they
> code for)?
> Did you try to run directly this commandline_BACON in  a unix terminal
> to see what it gives?
> You might have in commandline_BACON some characters that have special
> meaning for the shell (like "&", "*",">").
>
> Antoine
>
> --
> To unsubscribe from this mailing-list, please send an empty mail to
> users-unsubscribe at lists.scilab.org
> To check the archives of this mailing list, see
> http://mailinglists.scilab.org/
>
>
> --
> To unsubscribe from this mailing-list, please send an empty mail to
> users-unsubscribe at lists.scilab.org
> To check the archives of this mailing list, see
> http://mailinglists.scilab.org/
>
>




More information about the users mailing list