Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
category:
|
||||
- Environment variables
|
||||
- Initialization
|
||||
note: Programming environment operations
|
||||
note: Environment variables
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
TARGET = $(HOME)/some/thing.txt
|
||||
foo:
|
||||
echo $(TARGET)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
bar:
|
||||
echo "$$HOME"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
H = oops ...
|
||||
bar:
|
||||
echo $HOME
|
||||
|
||||
# prints oops ... OME
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
use POSIX 'getenv';
|
||||
print getenv("HOME"),"\n";
|
||||
|
|
@ -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"))
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
OSProcess thisOSProcess environment at: #HOME.
|
||||
OSProcess thisOSProcess environment at: #PATH.
|
||||
OSProcess thisOSProcess environment at: #USER.
|
||||
Loading…
Add table
Add a link
Reference in a new issue