NAME
couver-shell - C shell with file name completion and command line editing
COPYRIGHT
Couver-shell is Copyrighted © 2015-2016 by EPITECH-Lyon
DESCRIPTION
Couver-shell is a sh-compatible command language interpreter that
executes commands, read from standard input or read from a .couverc file.
It includes a command-line editor with advandced auto completion
and key rebinding, a history mechanism, and features or builtins
that are specific to the couver-shell (see builtin and features).
Editing
We first describe the command-line editor. The Completion and listing
and spelling correction sections describe two sets of functionality that
are implemented as editor commands but which deserve their own treatment.
Finally, Editor commands lists and describes the editor commands specific
to the shell and their default bindings.
The command-line editor (+)
Command-line input can be edited using key sequences much like those used
in GNU Emacs or vi(1).The editor is active only when the edit shell variables
are set, which it is by default in interactive shells. The bindkey builtin can
display and change key bindings.
down down-history
up up-history
left backward-char
right forward-char
Ctrl-A begin-line
Ctrl-E end-line
Ctrl-T last-word
Ctrl-Y previous-word
Completion and listing (+)
The shell is often able to complete words when given a unique abbreviation.
Type part of a word (for example ls /usr/lost
) and hit the tab key to run
the complete-word editor command.The shell completes the filename /usr/lost
to /usr/lost+found/
, replacing the incomplete word with the complete word in
the input buffer.(Note the terminal /
; completion adds a /
to the end of
completed directories and a space to the end of other completed words,to speed
typing and provide a visual indicator of successful completion. The addsuffix
shell variable can be unset to prevent this). If there is no match to be found
(perhaps /usr/lost+found
doesn't exist),the terminal bell rings. If the word is
already complete (perhaps there is a /usr/lost
on your system, or perhaps
you were thinking too far ahead and typed the whole thing) a /
or space is
added to the end if it isn't already there.
Completion works anywhere in the line, not only in the end; completed text
will be push to the right corner of the line. Completion in the middle of a
word often results in leftover characters to the right of the cursor that
need to be deleted.
Commands and variables can be completed in much the same way. For example,
typing em[tab]
would complete em
to emacs
if emacs were the only command
on your system beginning with em
. Completion can find a command in any
directory indicated in the shell path variable or in any given full pathname.
Lexical structure
The shell splits input lines into words, where spaces and tabs formerly separated them.
The special characters |
, ;
, <
, >
, and the double characters &&
, ||
, <<
and >>
are also considered as separaters, hence the words they are in the
middle of are pushed apart into differents substrings.
Easy scripting (+)
Couver-sell permits conditional actions, that is to say, scripting. (for example
if (1 == 1) echo "1 is equal to 1")
. Useful operators are !=
, >
,
>=
, <
, <=
, ==
.
BUILTIN AND FEATURES
-
cd: cd is a command that permits to move in a directory
-
usage:
cd [name directory]
cd -
permit to move back
cd
permit to move in the home -
echo: echo is a command that displays its arguments
-
usage:
echo [arg1] [arg2] ...
-
setenv: the setenv command adds or changes an environment variable
-
usage:
setenv [name] [value]
-
unsetenv: unsetenv can remove an environment variable
-
usage:
unsetenv [var1] [var2] ...
-
alias: the alias command permits to rename a command
-
usage:
alias [name] [cmd]
-
unalias: unalias can remove one or more alias
-
usage:
unalias [alias1] [alias2] ...
-
history: history is a command that permits to display the shell history
-
usage:
history
history -c
permit to clear the history -
set: the set command adds or changes a local variable
-
usage:
set [name] [value]
-
unset: unsetenv can remove a local variable
-
usage:
unset [var1] [var2] ...
-
bind: bind is a command that permits to change a key value
-
usage:
bin [old_key] [new_key]
-
couver-shell: this command display the couver-shell's logo
-
madeby: madeby display the project contributors
-
which: which allow to know the first path where is an executable
-
usage:
which [binary name]
-
where: where allow to know all paths where is an executable, he can
write error messages -
usage:
where [binary name]
-
repeat: repeat is a command who can repeat an other command
-
usage:
repeat [number] [command]
-
exit: exit command permit to quit the shell. You can use this command
with a argument number to quit with his error code. -
usage:
exit
exit [number]
OPTION
You can execute the couver-shell with two basics option. Option -c
who
permit to execute one command with our shell and --version option wich
give you the shell's version. (for example; ./42sh -c "ls"
);
FILES
/.42_history/.couverc
BUGS
No bugs. :)
SEE ALSO
bash(1), tcsh(1), csh(1)
AUTHORS
Vincent Couverchel
Bertrand Buffat
Mohamed-Laïd Hedia
Melvin Personnier
Vincent Riamon
THANKS TO
Our mums.
No one else, we are the bosses.
{EPITECH} 3 June 2016 COUVER-SHELL(1)
Et noubliez pas, sortez couver !