List Info

Thread: Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters




Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters
user name
2006-12-15 00:46:28
On Dec 14, 2006, at 18:57, Michael Selig wrote:
> I bet your script /usr/local/bin/p4 is a shell script
which doesn't  
> have a
> "#!/bin/sh" line at the top, and that if you
put one in, it will  
> work in
> both cases.

Nope.

$ file /usr/local/bin/p4
/usr/local/bin/p4: Mach-O executable i386

-- 
Eric Hodel - drbrainsegment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!


Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters
user name
2006-12-15 05:08:00
Sounds like the difference betwen exec and /bin/sh running p4 could still be the cause...
 
Try this, and see if there's anything missing from the bare "env" output that's present in the "env;" output that might affect perforce.
 
ruby -e 'system("env")'
ruby -e 'system("env;")'
 
I bet you'll find an env var that's maybe in .bashrc or the like, that isn't sourced when ruby uses /bin/sh to run the script.
 
--
Jim

 
On 12/14/06, Eric Hodel < drbrainsegment7.net">drbrainsegment7.net> wrote:
On Dec 14, 2006, at 18:57, Michael Selig wrote:
>; I bet your script /usr/local/bin/p4 is a shell script which doesn't
&gt; have a
> "#!/bin/sh" line at the top, and that if you put one in, it will
> work in
> both cases.

Nope.

$ file /usr/local/bin/p4
/usr/local/bin/p4: Mach-O executable i386

--
Eric Hodel - drbrainsegment7.net">drbrainsegment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!



Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters
user name
2006-12-15 21:25:25
On Dec 15, 2006, at 12:08 AM, Jim Helm wrote:

> Sounds like the difference betwen exec and /bin/sh
running p4 could  
> still be the cause...
>
> Try this, and see if there's anything missing from the
bare "env"  
> output that's present in the "env;" output
that might affect perforce.
>
> ruby -e 'system("env")'
> ruby -e 'system("env;")'
>
> I bet you'll find an env var that's maybe in .bashrc or
the like,  
> that isn't sourced when ruby uses /bin/sh to run the
script.

I think you're both barking up the wrong tree.

523 % ruby -e 'system "env"' | sort > x
524 % ruby -e 'system "env;"' | sort > y
525 % diff x y
17d16
< OLDPWD=/Users/ryan/Work/p4/zss/src/miniunit
26c25
< SHLVL=1
---
 > SHLVL=2
37c36
< _=/usr/local/bin/ruby
---
 > _=/usr/bin/env



[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )