Re: [PHP] shell expansion (globbing) from inside php cli script

2005-07-01 Thread Brian V Bonini
On Thu, 2005-06-30 at 10:47, Bob Winter wrote: Brian, Is /www/files/services/ the correct relative path?? You could try using the absolute path to see if it fixes the problem. Also, and maybe more significant, I use tcsh . . . if you use bash this could be the conflict. I see that

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-30 Thread Brian V Bonini
On Wed, 29 Jun 2005, Bob Winter wrote: Brian, The script works for me, I should have included the screen input/output, which now follows: Hmmm, this simply does not work for me. Maybe something with my version of php or ssh.. I'm at a loss.. $ php -v PHP 4.3.5 (cli) (built: Apr 30 2004

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-30 Thread Bob Winter
Brian, Is /www/files/services/ the correct relative path?? You could try using the absolute path to see if it fixes the problem. Also, and maybe more significant, I use tcsh . . . if you use bash this could be the conflict. I see that the echo of the $cmd string from PHP is missing the

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-29 Thread Brian V Bonini
On Tue, 28 Jun 2005, Bob Winter wrote: Brian, The format of your string that works for me is : $cmd = scp [EMAIL PROTECTED]:$directory/\{$files\} $tmp_dir; $files must be a comma separated string with NO SPACES. Here is my complete test script for your review: START =

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-29 Thread Bob Winter
Brian V Bonini wrote: I tried that too. I get '/{a,s,d,f\}' in the string if I use it that way. Are you saying that you were able to do a succesful transfer using the above? I can output a string that SHOULD work, e.g. scp [EMAIL PROTECTED]:/dir/{file1,file2,file3} /dir/. but when run from

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-28 Thread Brian V Bonini
On Mon, 2005-06-27 at 20:51, Jasper Bryant-Greene wrote: Brian V Bonini wrote: I can echo out the command and get a well formed command, i.e. one that will execute from a command prompt, but when I try to exec() $cmd from within the script the globbing is taken literally. Try

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-28 Thread Brian V Bonini
On Mon, 2005-06-27 at 22:04, Bob Winter wrote: Brian, Can you post more of the script? Sure. I also tried {{$files}} and tried calling a shell exclusively like: sh -s 'scp [EMAIL PROTECTED]' Anyway, here's more for the code surrounding the area in question, it's a little hacked up ATM but

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-28 Thread Bob Winter
Brian, The format of your string that works for me is : $cmd = scp [EMAIL PROTECTED]:$directory/\{$files\} $tmp_dir; $files must be a comma separated string with NO SPACES. Here is my complete test script for your review: START = #!/usr/bin/php ?php $file1 = 'file_A'; $file2 =

[PHP] shell expansion (globbing) from inside php cli script

2005-06-27 Thread b-bonini
Can not make this work inside a php script. Have tried several variations: $cmd = scp [EMAIL PROTECTED]:$directory/\{$files} $tmp_dir/.; $cmd = scp [EMAIL PROTECTED]:$directory/ . '{' . $files . '} ' . $tmp_dir/.; etc... I can echo out the command and get a well formed command, i.e. one that

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-27 Thread André Medeiros
$cmd = 'scp ' . $user . '@stagingcws.' . $tld . ':' . $directory/{' . $files . '} ' . $tmp_dir . '/'; That should work On 6/27/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Can not make this work inside a php script. Have tried several variations: $cmd = scp [EMAIL

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-27 Thread Brian V Bonini
On Mon, 27 Jun 2005, [ISO-8859-1] Andr? Medeiros wrote: $cmd = 'scp ' . $user . '@stagingcws.' . $tld . ':' . $directory/{' . $files . '} ' . $tmp_dir . '/'; That should work On 6/27/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Can not make this work inside a php script. Have tried

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-27 Thread Jasper Bryant-Greene
Brian V Bonini wrote: I can echo out the command and get a well formed command, i.e. one that will execute from a command prompt, but when I try to exec() $cmd from within the script the globbing is taken literally. Try shell_exec(). I don't think exec() goes via the shell. -- PHP General

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-27 Thread Bob Winter
Brian, Can you post more of the script? --Bob Brian V Bonini wrote: On Mon, 27 Jun 2005, [ISO-8859-1] Andr? Medeiros wrote: $cmd = 'scp ' . $user . '@stagingcws.' . $tld . ':' . $directory/{' . $files . '} ' . $tmp_dir . '/'; That should work On 6/27/05, [EMAIL PROTECTED] [EMAIL