CYGWIN creating problem in runing windows command from perl file?


#1

Actually i am using a perl file to run and do some task it contain
$command = “SET $some >aa.txt”;
system("$command");
here set is not working but env is working can any one suggest how to resolve this problem


#2

Is there anyone who can help?


#3

Is there any way to turn cygwin disable for my perl scripts to run in windows environment???


#4

This isn’t really chef related problem. You should ask this on cygwin forums
https://cygwin.com/lists.html


#5

But the libraries are installed with only… And located in embedded bin and perl of chef


#6

If you are in perl and trying to set a environment variable then there is a global hash for that %Env

Good luck!


#7

Can you explain me more with exactly what should i do?


#8

Sure.

I made a test folder and in that folder I made a perl script that tries to call an executable in a bin folder that I also made.

So, in ./bin we see a script called “action”:
$cat bin/action
#!/bin/sh
echo “RUNNING $1”

My script tries to call action and fails, then I add “./bin” to PATH and it finds it:

$cat script.pl
use Env qw(@PATH);
exec(“action ONE”);
push @PATH, “./bin”;
exec(“action TWO”);

Output:
$perl script.pl
RUNNING TWO

That is one way to programmatically modify PATH


#9

Its not helping me… Cant i remove cygwin compltely or turn cygwin env to windows env only


#10

Oh, I see.

Well, at this point, sending you to a site that explains using perl on windows would be the best help I can give you: http://perl-begin.org/platforms/windows/

I am currently working in bash and macosx shells…