package main

import (
    "fmt"
    "os"
)

func main() {
    fmt.Printf("PID:%v\n", os.Getpid())
    if len(os.Args) < 2 {
        fmt.Println("Done.")
        return
    }
    cp, err := os.StartProcess(os.Args[0], nil,
        &os.ProcAttr{Files: []*os.File{nil, os.Stdout}},
    )
    if err != nil {
        fmt.Println(err)
    }