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

os: os.ExpandEnv() inconsistent behavior with $- due to missing - as shell special parameter #16554

Closed
cuonglm opened this issue Jul 31, 2016 · 2 comments
Milestone

Comments

@cuonglm
Copy link
Contributor

@cuonglm cuonglm commented Jul 31, 2016

- is one of shell special parameters.

Function isShellSpecialVar() missed it so $- and ${-} is expanded inconsistently with os.ExpandEnv().


  1. What version of Go are you using (go version)?
    go version go1.6.3 linux/amd64

  2. What operating system and processor architecture are you using (go env)?

    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/cuonglm/go"
    GORACE=""
    GOROOT="/home/cuonglm/sources/go"
    GOTOOLDIR="/home/cuonglm/sources/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"
    
  3. What did you do?
    https://play.golang.org/p/EfqG4gN1so

  4. What did you expect to see?

    <nil>
    dash true
    dash
    dash
    
  5. What did you see instead?

    <nil>
    dash true
    -
    dash
    
@cuonglm cuonglm changed the title os: os.ExpandEnv() inconsistent behavior with $- due to missing - as shell special variable os: os.ExpandEnv() inconsistent behavior with $- due to missing - as shell special parameter Jul 31, 2016
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jul 31, 2016

CL https://golang.org/cl/25352 mentions this issue.

@quentinmit quentinmit added this to the Go1.8 milestone Aug 1, 2016
@cuonglm

This comment has been minimized.

Copy link
Contributor Author

@cuonglm cuonglm commented Aug 10, 2016

@quentinmit Would you mind reviewing https://golang.org/cl/25352 ?

@gopherbot gopherbot closed this in 1756b66 Aug 21, 2016
@golang golang locked and limited conversation to collaborators Aug 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.