Can someone explain about script variable "environment"? - g1ant

what is environment variable and how does it work?
♥image = ♥environment⟦USERPROFILE⟧\Desktop\image.png

Here is an explanation of environment variables on the G1ANT Website: Environment Variables
Basically what ♥environment⟦USERPROFILE⟧ is doing is specifying a path to C:\Users\YOURUSERNAMEHERE (The drive letter could be different, it is C:\ on my computer)
So ♥environment⟦USERPROFILE⟧\Desktop\image.png would be something like C:\Users\YOURUSERNAMEHERE\Desktop\image.png

Related

How to get the path of an folder in lua

does someone know how i can get the path of an folder in lua?
at the moment i use the path like this: "C:\Users\"..username.."\AppData\Roaming\Wireshark\plugins\RSTP_Dissector\channel_json"
My lua code is in the RSTP_Dissector folder. Does someone know how to work with the files in the channel_json folder without using the whole path like above?
"C:\\Users\\"..username.."\\AppData\\Roaming\\Wireshark\\plugins\\RSTP_Dissector\\channel_json"
From the documentation under "package.path":
A string with the path used by require to search for a Lua loader.
At start-up, Lua initializes this variable with the value of the
environment variable LUA_PATH_5_4 or the environment variable LUA_PATH
or with a default path defined in luaconf.h, if those environment
variables are not defined. A ";;" in the value of the environment
variable is replaced by the default path.
Like package.path = "C:\\Users\\"..username.."\\AppData\\Roaming\\Wireshark\\plugins\\RSTP_Dissector\\?.lua;".. package.path, add this code to the entry program, and you can use the relative path in the "C:\Users\"..username.."\AppData\Roaming\Wireshark\plugins\RSTP_Dissector" directory.
Hope to help you.

Rename environment variable key

I have following environment variable OLD_KEY=value and want to rename the env var name so it is KEY=value.
Already tryied export KEY=${${OLD_KEY}}.
Anyone who has an idea?
Is a POSIX shell, like bash, you dereference a variable with a single dollar-sign. So this is all you need:
export KEY="$OLD_KEY"
The double-quotes are always a good idea, even if you don't think they're needed due to quirks of the POSIX shell standard. Specifically, how variable expansion interacts with $IFS.
P.S., You should have told us which shell (or language) you're using rather than make us guess.

How to write Travis env variable to file?

I'm trying to write a custom Travis env variable to a file for a simple proof of concept thing that I need. However, I'm having trouble getting this to work.
How would I define this in the travis yaml file if my variable is called VARIABLE_X ?
Thanks!
One way to do this is using linux commands, something like:
printenv | grep VARIABLE > all_env
However I don't know how Travis handles the environment (take a look at their docs, here) but it might not work as easily due to encryption, but it should work since your apps wouldn't function if they didn't have the same level of access. If such a case occurs, modifying a few parameters (maybe TRAVIS_SECURE_ENV_VARS) is worth looking into.
If you solved the problem in another way, consider sharing with the community.
Write the environment variable as usual (Shell - Write variable contents to a file)
Define the following within script:
- echo "$VARIABLE_X" > example.txt

Viewing exported env vars with elixir

I understand how you set an environment variable using elixir.
export AWS_ACCESS_KEY_ID=your_access_key_id
Okay that works, but what if I'm not confident that I typed everything correct and I want to check what the value is? How can I do this with Elixir?
You could leverage the following function: System.get_env/1.

How can I define values from outside my script?

I'd like to pass some variables into my .nsi script. Either from the environment or the command line, how do I do this?
I found a section in the documentation that suggests I can use the syntax $%envVarName% to use environment variables in my script, but this doesn't seem to work, when I have
File "/oname=$pluginsdir\inst.msi" "$%VERSION%-Installer-64bit.msi"
I get the error
File: "$%VERSION%-Installer-64bit.msi" -> no files found.
$VERSION is in my environment.
Is there something I'm doing wrong with trying to read environment variables, or some other way of passing values into my script?
$%VERSION% should work if you used set VERSION=1.2.3.4
Or you can create defines: makensis -DVERSION=1.2.3.4 myscript.nsi and File: "${VERSION}-Installer-64bit.msi"

Resources