I need to execute this sort of command through the Go programming language:
find /some/dir/path -type f \( -iname \*.zip -o -iname \*.tar -o -iname \*.rar \)
I discovered exec.Command and tried various ways of executing the find
command,
e.g.
exec.Command("find", dir, "-type", "f", "\\( -iname \\*.zip -o -iname \\*.tar -o -iname \\*.rar \\)")
exec.Command("find", dir, "-type", "f", "-iname", "*.zip", "-o", "-iname", "*.tar", "-o", "-iname", "*.rar")
exec.Command("find", dir, "-type", "f", "\\(", "-iname", "\\*.zip", "-o", "-iname", "\\*.tar", "-o", "-iname", "\\*.rar", "\\)")
None of the above have worked for me. Is there a way to do this, or am I just going to have to issue 3 separate find commands in Go?