PDA

View Full Version : Pb with psexec to execute remote commands


Florian
12-02-2004, 08:14 AM
Hi,
I try to performe a search of string into some files in a remote process for a reporting into the Visual build console. This step is write like this :

<step action='Run Program' type='0'>
<command><![CDATA[psexec \\%NG_MACHINE_CIBLE% -u %NG_USER_SESSION_PSEXEC% -p %NG_PWD_SESSION_PSEXEC% -e bash -c "cd %NG_PROJET%;echo ""---- Erreurs de compilation ----"";find . -name \*Debug.err -exec grep -c -H -e ""[[1-9]][[0-9]]*\ error\(s\)"" {} \; 2> /dev/null"]]></command>
<condcompareto>YES</condcompareto>
<condcomparison type='3'>3</condcomparison>
<condexpr>%NG_COMPILE_DEBUG%</condexpr>
<indent type='3'>1</indent>
<name>Verification de la compilation DEBUG</name>
<outputfrom type='3'>1</outputfrom>
</step>

the command works if i use it in a console like cmd.exe but doesn't work if i use it in a step. The output of this step is only : ---- Erreurs de compilation ---- ..... I try lot of solution but nothing works !

Could u help me ?

Thks for all comments :)


Delom Florian

Florian
12-02-2004, 11:14 AM
Example of command i want to script :

psexec \\MA0210140 -u TOTO -p TOTO -e bash -c "cd d:/projet ; echo ""---- Erreurs de compilation ----"" ; find -name \*Debug.err -exec grep -c -e -H ""[1-9][0-9]*\ error\(s\)"" {} \; 2> /dev/null"

kevina
12-02-2004, 11:29 AM
Hmm, not sure. You could try prefixing your command-line with the %DOSCMD% macro to explicitly tell the command to execute withing a cmd.exe console...

Florian
12-02-2004, 11:38 AM
It doesn't work... sorry... :(

Florian
12-02-2004, 12:21 PM
In fact it works... but sometimes it doesn't. I compile the step once it works but if i recompile it another it doesn't and exit bash with a broken pipe error.... Have u an explanation for that problem ? The problem doesn't exist if i use my command line in console like cmd. I can execute it lot of time without problem.