Bash Mode Help
Name:Bash Mode
Version:0.2
Last update:2021-02-25 11:18:23





Introduction

Bash Mode is a mode for the text editor Alpha: it installs basic support for editing script files for the Bourne Again Shell (aka bash) using the Alpha text editor. This mode provides the following features: Click on this Bash Example link for an example syntax file.

Editing in Bash mode

There are several ways of editing a file in Bash mode:

Completions

There are two aspects for word completion in Bash mode: The flow control keywords recognized by the Bash mode are: case, for, func, if, ifelif, ifelse, select, until, while.

File marking

You can mark two kinds of items using the Marks popup (📖):

Parse popup

In Bash mode, the Parse popup (⚙) of document windows displays the function definitions found in the document. The bash syntax provides two forms of function definition and Bash mode recognizes both. For instance, you can write either
foo () {
	echo bar
}
or
function foo {
	echo bar
}

Key bindings

The following key bindings are defined in Bash mode:

Script execution

The Ctrl-X key binding lets you execute the contents of the document window by sending it to the Mac OS X Terminal. The command takes care of launching the Terminal application if it is not already running. Bash mode makes some preliminary checks before sending the script: it verifies that the execute flag is set, that the window has Unix line endings and that is has been saved.
Note that you can set the executable flag of a file manually in Alpha using the Info popup (🄸) located in the control bar of the document window. There is an item called Executable… which can be set on or off.

Known problems

Please report any problem or bug you encounter in Alpha's Bug Tracker.

License and Disclaimer

Copyright (c) 2005-2021, Bernard Desgraupes.
All rights reserved.
The Bash Mode package is free software and distributed under the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BERNARD DESGRAUPES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.