The module "mastrave" of the Mastrave modelling library


Daniele de Rigo


Copyright and license notice of the function mastrave



Copyright © 2009,2010,2011,2012 Daniele de Rigo

The file mastrave.m is part of Mastrave.

Mastrave is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Mastrave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Mastrave. If not, see

Function declaration



 [ answer, status ] = mastrave( varargin )




Binder for the Mastrave/sh manager utility. The Mastrave/sh library is the GNU Bash based part of the Mastrave project. It is a collection of bash utilities aiming to ease the adoption of an abstract and vectorized approach to the GNU command line. Mastrave/sh does not attempt to replicate the main set of Mastrave utilities for GNU Octave and MATLAB computing environments, since the Bash shell is pretty different from them. Despite Bash scripting should not be intended as an array programming language, it natively allows array operations on variables and files. Mastrave/sh provides a set of tools which strengthen the vectorizability of Bash programs while allowing a more abstract access to low-level features.

This function allows directly accessing the Mastrave/sh manager. The updated version of options and arguments it is able to manage can be read by typing the command:

mastrave --help

Input arguments



Example of usage



   % Invoking as standalone a Mastrave/sh sub-function
   % (Creating a temporary writable directory)
   tmp = mastrave( 'tmp_dir', '--create' )

   % Invoking a Mastrave/sh command
   % Equivalent in GNU Octave/MATLAB of the Bash version:
   %    echo '10 60 20 80 30 20' | tr ' ' '\n' | mastrave msort -i "\$tmp"/idx
   mastrave( '-', [10 60 20 80 30 20].', 'msort', '-i', [ tmp '/idx'] )
   fileread( [ tmp '/idx'] ).'
   % (Removing the temporary directory along with its content)
   mastrave( 'tmp_dir', '--remove', tmp )

See also:

   Bash, binder

Version: 0.1.11




The Mastrave modelling library is committed to provide reusable and general - but also robust and scalable - modules for research modellers dealing with computational science.  You can help the Mastrave project by providing feedbacks on unexpected behaviours of this module.  Despite all efforts, all of us - either developers or users - (should) know that errors are unavoidable.  However, the free software paradigm successfully highlights that scientific knowledge freedom also implies an impressive opportunity for collectively evolve the tools and ideas upon which our daily work is based.  Reporting a problem that you found using Mastrave may help the developer team to find a possible bug.  Please, be aware that Mastrave is entirely based on voluntary efforts: in order for your help to be as effective as possible, please read carefully the section on reporting problems.  Thank you for your collaboration.

Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Daniele de Rigo

This page is licensed under a Creative Commons Attribution-NoDerivs 3.0 Italy License.

This document is also part of the book:
de Rigo, D. (2012). Semantic Array Programming with Mastrave - Introduction to Semantic Computational Modelling.

Valid XHTML 1.0 Transitional