Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golang exec /bin/bash with ENV PS1 does not work #2

Open
LyleLee opened this issue Sep 2, 2020 · 0 comments
Open

Golang exec /bin/bash with ENV PS1 does not work #2

LyleLee opened this issue Sep 2, 2020 · 0 comments

Comments

@LyleLee
Copy link
Owner

LyleLee commented Sep 2, 2020

	cmd := exec.Command("/bin/bash")

	cmd.Stdin = os.Stdin
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr

	cmd.Env = []string{"PS1=-[ns-process]- # "}
        root@intel6248:/home/user1/go/src/github.com/Lylelee/jail# env
        LS_COLORS=
        LESSCLOSE=/usr/bin/lesspipe %s %s
        PWD=/home/user1/go/src/github.com/Lylelee/jail
        SHLVL=1
        PS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$
        LESSOPEN=| /usr/bin/lesspipe %s
        _=/usr/bin/env

The output should be something like https://medium.com/@teddyking/namespaces-in-go-reexec-3d1295b91af8

    -[ns-process]- # 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant