[go-nuts] Re: exec.Command() always returns error status of 1 when it was executed successfully

2020-02-18 Thread Brian Candler
On Tuesday, 18 February 2020 01:40:32 UTC, Dean Schulze wrote: > > I expected it to return 0 when executing successfully. What am I missing? > Given your pipeline: lspci | grep -i vga | grep -i nvidia the exit status returned is the exit status of the last command (grep -i nvidia). Then if yo

[go-nuts] Re: exec.Command("cp", "-r", "./*.json", artifact.dir fails with exit status 1

2017-01-16 Thread Dave Cheney
The problem is expanding shell meta characters like *, ? and ~ is a property of the _shell_, as Dan mentioned above. You are executing a command directly so the shell is not involved and cannot expand *.json into a list of files ending with .json. A cheap solution to this might be something lik

[go-nuts] Re: exec.Command("cp", "-r", "./*.json", artifact.dir fails with exit status 1

2017-01-16 Thread Deepak Jain
I appended pwd command output to source directory, i still get same error. pwd := util.ExecuteCommandWithOuput(exec.Command("pwd")) fmt.Println("pwd", pwd) util.ExecuteCommandWithOuput(exec.Command("cp", "-r", pwd+"/./*.json", artifact.dir)) Output: Cmd:[cp -r /Users/userId/sd101 /./*.json mya

Re: [go-nuts] Re: exec.Command

2016-10-06 Thread Marvin Renich
* hadiesmail...@gmail.com [161005 09:16]: > but i test this code it does not work! > > Why?? People would be able to help you better if you said what you tried (by giving code; you can use play.golang.org if you want), and saying what happened and what you expected or wanted to happen. Also, so

Re: [go-nuts] Re: exec.Command

2016-10-05 Thread Brad Fitzpatrick
You didn't say how it doesn't work. You need to ask good questions to get good answers. On Wed, Oct 5, 2016 at 6:16 AM, wrote: > but i test this code it does not work! > > Why?? > > > On Wednesday, October 5, 2016 at 2:46:37 AM UTC-7, hadies...@gmail.com > wrote: >> >> hi >> >> in the second ar

[go-nuts] Re: exec.Command

2016-10-05 Thread hadiesmaili85
but i test this code it does not work! Why?? On Wednesday, October 5, 2016 at 2:46:37 AM UTC-7, hadies...@gmail.com wrote: > > hi > > in the second arg in function exec.Command(), what i must put it?? > > and any my question is : > > i want run a cmd command.for example : cls > > how can i run t