YS Global Variables
Last night a gave a talk about YS and YAML to the Toronto DevOps Meetup
.
I had a lot of fun, and met a lot of great people.
Today I'm going to share one of the things I covered last night. Global variables.
It's not the most exciting topic, but it can be useful.
YS has some predefined global variables🔗
Yesterday I we talk about the ENV
variable which is one of the predefined
global variables.
It's probably the most useful one.
But there are other ones that you can use too.
Stdio Handles🔗
-
IN
- Standard Input file handle -
OUT
- Standard Output file handle -
ERR
- Standard Error file handle
Command Line Arguments🔗
-
ARGV
- A program's command line arguments. A vector of strings. -
ARGS
- Same asARGV
but as but args the look like numbers are converted to numbers.
File System🔗
-
FILE
- The absolute path to the program's file. -
DIR
- The absolute path to the program's directory. -
CWD
- The current working directory.
Runtime Values🔗
-
RUN
- A map of a few runtime values:RUN.bin
- The absolute path to the directory of theys
binary.RUN.pid
- The process ID of the current process.RUN.versions
- The versions of key components in theys
binary.
-
VERSION
- The version of theys
binary.
That's all for today. Headed out for a weekend of Summertime camping.
See you tomorrow if there's wifi in the woods!