Skip to content
Snippets Groups Projects
migrating.md 1.06 KiB
Newer Older
AdminXVII's avatar
AdminXVII committed
# Migrating from POSIX Shells

## Notable changes
AdminXVII's avatar
AdminXVII committed
 - Arrays are full-class citizens, using the @ sigil. That means emails and git urls must be single quoted
AdminXVII's avatar
AdminXVII committed
 - The shell has proper scopes (variables get unset after the end of the definition scope), and functions are closures
 - The shell has an internal variable store. That means environment variables must be explicitly exported to be available to commands.
AdminXVII's avatar
AdminXVII committed
 - For now, per-command environment variables are not supported (ex: `LANG=it_CH.utf8 man man`)
 - The testing builtin (`[[ .. ]]`) was replaced with `test`, `exists`, and/or other commands
 - The control flow have been revisited, see the relevant part of the manual

## Customizing your prompt
AdminXVII's avatar
AdminXVII committed
 - Define the PROMPT function to be called whenever the prompt needs to be drawn. Simply print the prompt to stdout in the function (printf or git branch directly)
AdminXVII's avatar
AdminXVII committed
 - Variables are defined with all the colors (see the namespaces manual page for all details). This means you don't have to deal with all the escape codes directly. No more `\x033[33;m`, instead it's `${color::yellow}`.