Skip to content

Supported Features

This page lists the features and syntax supported by Bunster. you must consider any feature that is not mentioned here as work-in-progress and as not-yet-supported.

Code Example

shell

# simple command
echo "Hello World"

# redirections ('<<' here document is not yet supported)
echo foobar >output.txt >>append.txt &>all.txt
echo foobar 3>file.txt 2>&3 >&3-
cat <input.txt <<<"Hello World" 3<input.txt
cat 3<>io.txt 3>&-

# pipelines
cat file.json | jq '.filename' | grep "*hosts.txt"
! true

# conditional execution
command || command2 && command3

# shell parameters
key=value
key="value"
key='value'

echo "$key"

# passing shell parameters as environment variables
key=value kay2=value command

# subshells
(
  echo foo bar | cat
)

# groups
{
  echo foo bar | cat
}

# command substituion
echo "files: $(ls "$path")"

# `if` command
if true; then
    echo foo bar | cat
elif true; then
    echo baz boo
else
    echo bad
fi


# `while` loop
while true; do
  echo foo bar | cat

  true && break || continue
  done


# `until` loop
until true; do
  echo foo bar | cat

   true && break || continue
   done

# `for` loop
for arg; do

  # `for` loop over arguments
  for arg in foo bar baz; do
    echo $arg
    done

  echo foo bar | cat

   true && break || continue
done

# running commands in backgroud
command &

# functions
function foo() {
  echo foobar

  # local variables
  local key=value
}

Released under the 3-Clause BSD License.