cmd icon indicating copy to clipboard operation
cmd copied to clipboard

special character '>'

Open 2013kaa opened this issue 1 year ago • 1 comments

Hello I have a command to build gradle like: ./gradlew build final dependencies > dep.txt

but when executed through cmd.NewCmdOptions it gives an error when building in the Gradle: Task '>' not found in root project 'xxxx'.

tell me how to solve the problem?there may be some kind of special character escaping >

2013kaa avatar Feb 12 '24 15:02 2013kaa

> is output redirection, not part of the command. So use Options to set streaming or buffered output (and to combine STDOUT or STDERR or not). If you choose streaming output, you'd read Cmd.Stdout (and/or .Stderr) channels and write them to a file. If you choose buffered output, you'd copy Status.Stdout (and/or .Stderr) to file.

daniel-nichter avatar Feb 16 '24 15:02 daniel-nichter