Skip to content

katef/qs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Responsibilities:

 - Process management
 - Setting up pipes and redirections
 - Signal handling (for instance interrupting a running program)
 - Variables
 - Control flow, with structured and procedural constructs (functions, loops, conditionals and so on)
 - Tokenisation and operations on the one data type: lists of words

Features which are purposefully excluded:

 - Job control
 - Prompting
 - Line editor and command history
 - Globbing
 - Arithmetic and similar expression syntax
 - Environment
 - Here documents

Pre-populated variables:

 $? command exit status  global
 $_ command value        global
 $$ process ID           global
 $# argc                 per call
 $* argv                 per call
 $^ field separator      local
 $. current block        local

Scope:

 Variable names search the local scope first, and then up the tree of parent
 scopes. If a variable by that name is found in any scope along the way,
 that is the variable used for assignment or dereferencing. If no such variable
 was found, assignment then declares the variable in the local scope, and
 derefrencing is an error.

 Variables names prefixed with a dot act on local scope only. The dot is not
 part of the variable name.