Oils Reference — Chapter OSH Assignment

This chapter describes OSH assignment, which looks like x=value.

(in progress)

In This Chapter

Operators

sh-assign

sh-append

Compound Data

sh-array

Array literals in shell accept any sequence of words, just like a command does:

ls $mystr "$@" *.py

# Put it in an array
a=(ls $mystr "$@" *.py)

Their type is BashArray.

In YSH, use a list-literal to create a List instance.

sh-assoc

Associative arrays map strings to strings:

declare -A assoc=(['k']=v ['k2']=v2)

Their type is BashAssoc.

In YSH, use a dict-literal to create a Dict instance.

Builtins

local

readonly

export

unset

shift

declare

typeset

Another name for the declare builtin.

Generated on Sun, 25 Aug 2024 12:30:01 -0400