Categorygithub.com/pbar1/pkill-go
modulepackage
1.0.0
Repository: https://github.com/pbar1/pkill-go.git
Documentation: pkg.go.dev

# README

pkill-go

GoDoc Go Report Card

Like pkill and pgrep, in pure Go without using exec.Cmd.

go get github.com/pbar1/pkill-go

Usage

package main

import (
  "fmt"

  "github.com/pbar1/pkill-go"
)

func main() {
  pids, err := pkill.Pgrep("^go$")
  if err != nil {
    fmt.Println(err)
  }
  for _, pid := range pids {
    fmt.Println(pid)
  }
}

# Packages

No description provided by the author

# Functions

Pgrep functions like `pgrep`, returning a list of PIDs by regular expression on their executable name.
Pkill functions like `pkill`, sending a signal to each process found by regular expression on their executable name, and returning a list of PIDs and any errors during execution.