On Wed Apr 20, 2022 at 6:16 PM CEST, Dean Schulze wrote:
> I need to execute this tar command
>
> *tar xzf dir1/dir2/somefile.tgz --directory=dir1/dir2/*
>

Did you considered using the packages "archive/tar" and
"compress/gzip" to achive this?

> *argStr := "xzf dir1/dir2/somefile.tgz --directory=dir1/dir2/"output, err
> := exec.Command("tar", argStr).Output()*
>

exec.Command arguments are variadic, each argument is one argv, thus I
think you meant exec.Command("tar", "xzf", "dir1/dir2/somefile.tgz",
"--directory=dir1/dir2/")

-w

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CJF7II5MD0Y9.2Y2HYXCZ4QDSC%40pampas.

Reply via email to