Basic usage

As with any other shell, you type in commands at the prompt.  In marcel terminology, an operator is a single command, built in to marcel. For example, the pwd operator prints the current directory (pwd = print working directory, as in Linux):

 

You can also run host OS executables. Marcel doesn't have a builtin operator named which, but you can run which (on Linux and Mac, at least), because that is an executable in the host operating system.

In some cases, marcel and the host OS will have operators and commands with the same name. In these cases, the marcel operator serves the same general purpose as the host OS executable, but typically has fewer options, and its behavior has been designed to fit into marcel better. An example of this is ls. For example, notice that ls always produces a detailed listing (like Linux's ls -l):

Marcel maintains a set of environment variables. Like many other Linux shells, there are entries for USER (your username), PWD (the current directory), and there are other entries. You can examine the complete environment by running the env operator.

You can also examine one of the variables by enclosing the variable's name in parentheses, e.g.

In general, parentheses delimit aribtrary Python expressions, so you can also do arithmetic:

or computations involving other Python types, e.g.

The history command generates a stream containing the most recent commands you have entered, (this shows the end of the output from running history):

You can edit the most recent command by running the edit command.  Or to edit an earlier command, run edit N, where N is the identifier of a command printed by the history operator, (one of the blue numbers above). As in other shells, the value of the EDITOR environment variable can be set to determine the editor to be used for editing commands.

You can also do command-line editing using familiar controls, e.g.

  • Ctrl-A: Go to the beginning of the line.

  • Ctrl-E: Go to the end of the line.

  • Ctrl-W: Delete the previous word.

  • Ctrl-U: Delete everything before the cursor.

  • Ctrl-K: Delete everything starting at the cursor.

  • Ctrl-R: Reverse search command history.

  • Up arrow, Ctrl-P: Recall previous command in history.

  • Down arrow, Ctrl-N: Recall next command in history.


You can also recall previous commands. !! recalls the most recent command, and !N recalls command N.

 

  • github
  • Twitter
  • email