Skip to content

eomain/ash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ash: acorn shell (2018)

ash is a command shell interpreter. Commands can either be read directly from
the user at the command prompt or from a given file, upon which they are evaluated
and executed. You can use ash to write/run shell scripts with the following properties.
Set and unset both atomic and composite (tuple) variables, evaluate expressions and use
some common programming language constructs, such as if-else statements,
loops (for and while) and functions.

Please note that as of now ash does not have a stable release and some
features that may be missing are still in development.


Project directories:

    ash:        source directory
    doc:        documentation
    include:    header files
    lib:        library
    share:      misc
    tests:      ash test scripts

Basic usage:

    # to display prompt
        help

    # to list builtin commands
        list

    # to change directory
        cd <directory>

    # set a variable
        let var := "acorn"

    # to print variable:
        echo $var

    # to evaluate an expression
        ` 2 + 2 `  # 4

    # if statement
        if [ true ]
            read -p "enter name: " name
            echo "welcome { $name }"
        end

    # for loop
        for i in 0 to 10
            echo $ASH
        end

    # function
        def main(var)
            echo $var
        end

        main("this is a function")

    # load/import a script into the current shell
        source <script>

    # execute a script (needs ash to be installed on the path
    # and must have execute permission)
        ./script

Author:
    eomain

acorn shell (2018)