Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1 +1,6 @@
Show how to get one of your process's [[wp:Environment variable|environment variables]]. The available variables vary by system; some of the common ones available on Unix include PATH, HOME, USER.
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}} <!-- Does not have an environment other than regular global variables. -->
{{omit from|M4}}
{{omit from|Unlambda|Does not provide access to environment variables.}}
{{task|Programming environment operations}}
Show how to get one of your process's [[wp:Environment variable|environment variables]].
The available variables vary by system; some of the common ones available on Unix include PATH, HOME, USER.

View file

@ -2,4 +2,4 @@
category:
- Environment variables
- Initialization
note: Programming environment operations
note: Environment variables

View file

@ -0,0 +1,3 @@
TARGET = $(HOME)/some/thing.txt
foo:
echo $(TARGET)

View file

@ -0,0 +1,2 @@
bar:
echo "$$HOME"

View file

@ -0,0 +1,5 @@
H = oops ...
bar:
echo $HOME
# prints oops ... OME

View file

@ -0,0 +1,2 @@
use POSIX 'getenv';
print getenv("HOME"),"\n";

View file

@ -1,9 +1,8 @@
object Environment_variables extends App {
val variablesToUse = List("PATH", "HOME", "HOMEPATH", "USERNAME")
println((for {
y <- sys.env
x <- variablesToUse
if y._1 == x
} yield y).sorted.toMap.mkString("\n"))
def variablesToUse = Seq("USERPROFILE", "java.library.path", "PATH", "HOME", "HOMEPATH", "USERNAME")
println(sys.env.filter(p => variablesToUse contains p._1).toMap.mkString("\n"))
println
println (System.getProperty("java.library.path").split(";").mkString("\n"))
}

View file

@ -0,0 +1,3 @@
OSProcess thisOSProcess environment at: #HOME.
OSProcess thisOSProcess environment at: #PATH.
OSProcess thisOSProcess environment at: #USER.