Command Expansion problem


(Peter McGregor) #1

Hello,

I am using the following command inside ruby

runCmd = %x{curl --proxy 192.168.0.5:3128 -d
userName=aaaa -d password=password -d command=put -o
./temp/putOutput.txt -d fileName=abc --config
./temp/tmpDataConfig.txt
https://192.168.0.8/RF/RemoteFileAccess}

This command fails within ruby but works on the
command line{in Linux}

Within Ruby Curl tries to open a Config file but
silently fails.

Is Ruby supposed to allow OS type commands like Curl
to open their own files?

I looked at ruby libCurl but it doesn’t run on
windows.

Thanking you in advance

Peter McGregor


(Yohanes Santoso) #2

Peter McGregor pdm@advso.co.nz writes:

runCmd = %x{curl --proxy 192.168.0.5:3128 -d
userName=aaaa -d password=password -d command=put -o
./temp/putOutput.txt -d fileName=abc --config
./temp/tmpDataConfig.txt
https://192.168.0.8/RF/RemoteFileAccess}

irb(main):001:0> runcmd=%x{echo hai
irb(main):002:0how are irb(main):003:0 you}
sh: how: command not found
sh: you: command not found
"hai\n"
irb(main):004:0> runcmd=%x{echo hai
irb(main):005:0how are\ irb(main):006:0 you}
"haihow areyou\n"
irb(main):007:0> runcmd=%x{echo hai how are you}
“hai how are you\n”

YS.