[11] Results

Golang : Execute shell command

shell-command exec

A programming language will not be complete if there is no way for the developer to execute shell command. In….... read more


Golang : Get absolute path to binary for os.Exec function with exec.LookPath

golang lookpath absolute-path exec

Sometimes it is good to tell our Golang program to execute exactly which binary file based on the path. For….... read more


Golang : read gzipped http response

golang http gzip exec

There are times when we want to grab a website content for parsing(crawling) and found out that the content is….... read more


Golang : Force your program to run with root permissions

golang sudo root permissions exec id

Problem:

Because of security requirements, you need to create programs that can only be executed with the proper root permissions.….... read more


Golang : Capture text return from exec function example

golang os exec capture-return-text stdout

Problem:

You want to capture the text result return by exec function. How to do that?

Solution:

The code….... read more


Golang : Capture stdout of a child process and act according to the result

golang stdout child-process shell exec

Let say you want to execute a shell command of a child process in your main program and want to….... read more


Golang : Verify Linux user password again before executing a program example

golang password authentication pamexec

One of my previous tutorial shows you how to restrict a program execution to root only and this can….... read more


Golang : How to pipe input data to executing child process?

golang input-pipe input-data os-exec

Problem :

Your program is executing a child process via os/exec and you want to pipe input data to the….... read more


Advertisement

Advertisement