I want to create an array of exec.Cmd and pipe them together to make an squid authenticator. It works when the commands in file have no arguments. With arguments, it only reads EOF. I've checked the argv array and its content is ok.
The relevant portion of the code is:
func initCmd(file *os.File) []* exec.Cmd {
var cmd [MAX_PROC]* exec.Cmd;
var e os.Error
// Initialize the commands in the config file
environ := os.Environ();
var i int
for i=0; i < MAX_PROC; i++ {
line := getLine(file)
if line == "" { break }
parts := strings.Fields(line)
cmd[i], e = exec.Run(parts[0], parts[1:], environ,
exec.Pipe, exec.Pipe, exec.Pipe)
exitOnError(&e)
}
return cmd[0:i]
}
Any ideas? Thanks.
PS: If it helps, the complete program source is at github.