When I try to execute the make command of Makefile with os / exec of golang, the second and subsequent executions result in an error.

Cause

I do not understand

Workaround

Call the make command in the shell

Go side

――It should be okay if it is not a full pass


		cmd := exec.Command("/home/yuta/AWS/go/bin/exec.sh", domain.Name)
		cmd.Run()

Shell side

--Give execute permission with chmod in advance

exec.sh


#!/bin/sh

cd /home/yuta/AWS
make make-env-config ENV_FILE=.env DOMAIN_NAME=${1}

Recommended Posts

When I try to execute the make command of Makefile with os / exec of golang, the second and subsequent executions result in an error.
I made an appdo command to execute a command in the context of the app
An introduction to cross-platform GUI software made with Python / Tkinter! (And many Try and Error)! (In the middle of writing)
I get an OS Error: [Errno 8] Exec format error when running a Flask application with a python command
I want to leave an arbitrary command in the command history of Shell
[Python] I want to know the variables in the function when an error occurs!
I want to store the result of% time, %% time, etc. in an object (variable)
It is easy to execute SQL with Python and output the result in Excel
Try to get the contents of Word with Golang
[Golang] Command to check the supported GOOS and GOARCH in a list (Check the supported platforms of the build)
Check the argument type annotation when executing a function in Python and make an error
When I try to connect to MySQL with mysql-connector-python, I cannot connect with the error "SSL connection error: SSL_CTX_set_tmp_dh failed"
When accessing a URL containing Japanese (Japanese URL) with python3, it will be encoded in html without permission and an error will occur, so make a note of the workaround.
[Python] Visualize Arashi's lyrics with WordCloud and try to understand what I wanted to convey to fans in the 20th year of formation.
I want to improve efficiency with Python even in an experimental system (4) Use ser.close () when an error is thrown using try syntax
I got an error when I tried to process luigi in parallel on windows, but the solution
When I try to divide a list with MeCab, I get'TypeError: in method'Tagger_parse', argument 2 of type'char const *''
When I get an error with Pylint in Atom on Windows
I get an error when trying to install maec 4.0.1.0 with pip
I tried to make an analysis base of 5 patterns in 3 years
I want to make the second line the column name in pandas
I tried to display the analysis result of the natural language processing library GiNZA in an easy-to-understand manner
[Question] In sk-learn random forest regression, an error occurs when the number of parallels is set to -1.
I made an npm package to get the ID of the IC card with Raspberry Pi and PaSoRi
I got an error when trying to install Xgboost and its solution
I want to batch convert the result of "string" .split () in Python
I tried to control the network bandwidth and delay with the tc command
Try to separate the background and moving object of the video with OpenCV
Setting to make the scale and label of the figure easy to see even in the dark theme with google Colaboratory
I'm an amateur on the 14th day of python, but I want to try machine learning with scikit-learn
I wanted to know the number of lines in multiple files, so I tried to get it with a command
When I try to connect django and postgresql with Docker, I get the error "django.db.utils.OperationalError: could not translate host name" db "to address: Name or service not known"
The story of an error in PyOCR
When I get an error with PyInstaller
How to pass the execution result of a shell command in a list in Python
In the Chainer tutorial, I get an error when importing a package. (mock)
I installed Pygame with Python 3.5.1 in the environment of pyenv on OS X
I got an error when trying to run Hello World in Go language
I got an error when I put opencv in python3 with Raspberry Pi [Remedy]
[python] What to do when an error occurs in send_keys of headless chrome
I want to send Gmail with Python, but I can't because of an error
A memorandum of how to execute the! Sudo magic command in Jupyter Notebook
linux / c> link> Get the execution result of the shell command in the C program> I was taught how to use popen ()