We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This would enable expansions for shell script positional arguments, e.g.
> cat print.sh echo $1 > print.sh foo foo # $1 expanded to foo
It would directly solve our use case in Wanix where we use go-posix for shell preprocessing.
mapping := posix.Map{} for i, scriptArg := range os.Args { mapping[strconv.Itoa(i)] = scriptArg } posix.Expand(shellScript, mapping)
Here's a possible implementation:
func lexStartExpansion(l *lexer) stateFn { c := l.next() switch { case c == eof: l.emit(itemText("$")) return nil case c == '{': l.ignore() l.depth++ return lexBracketName - case isAlpha(c): + case isAlphaNum(c): return lexSimpleName } return nil // FIXME }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
This would enable expansions for shell script positional arguments, e.g.
It would directly solve our use case in Wanix where we use go-posix for shell preprocessing.
Here's a possible implementation:
The text was updated successfully, but these errors were encountered: