PDA

View Full Version : problem to exec a local command


MrJake
12-03-2002, 04:59 PM
Im trying to use unix commands via cygwin on a nt server. that part i solved and it works great. if i go in dos prompt and type grep or cut or cat it works. But i cant call those commands via perl on a cgi script on the web server which is on the same machien of course. Always give me the error message :
'grep' is not recognized as an internal or external command, operable program or batch file.

Im trying to call grep and cut. this is how i had it



$grepip = exec ("grep -o [0-9]*[0-9]*[0-9].[0-9]*[0-9]*[0-9].[0-9]*[0-9]*[0-9].[0-9]*[0-9]*[0-9] | grep -n 1 | cut -f2 -d:")



But it does work. I even tried with system. Cygwin is installed in c:\cygwin and i have c:\cygwin\bin in my system path. Also my web is in d drive.

Anyways I dunno why i can use all those cygwin commands in dos but perl says he cant find them. why would the be?