-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement printenv
#5
Conversation
The feature (environment variable printing) is basically completed. The order of See comment-875244187. |
I am writting a testing script, I get different output from In terminal,
Use result_origin := os.execute('printenv --null LANGUAGE LANG')
println(result_origin.output) the output is not |
Since it is important that the output is as correct as possible (even if it's in a different order), I'd prefer to hold this until the the V issue is fixed. Any objections? |
I will commit the initial version of the test script and add comments about the issues to the code, then wait for the issues to be resolved. |
The order of os.environ() is different from the original printenv(run on Ubuntu 18.04, coreutils 8.28). original
In current V implementation, I use for k, v in os.environ() {
mut s := '$k=$v'
if nul_terminate {
print(s)
} else {
println(s)
}
} The output is like:
The original output has a specific order, not just in alphabetical order.
|
Prepare for
printenv
implementation.Currently, I implement a simple function of printing available parameters, which can be used as a template reference for developing other utilities in the future.