Zoidberg

 view release on metacpan or  search on metacpan

man1/zoiduser.pod  view on Meta::CPAN

	/bin:/usr/bin/:/usr/local/bin
	zoid$ echo $PATH[2]
	/usr/local/bin
	zoid$ echo @PATH
	/bin /usr/bin/ /usr/local/bin

If the command matches an entry in the C<$$shell{commands}> hash, it is taken to be
a built-in command and the job is not forked to a seperate process.

=back

=head3 FIXME

FIXME comment on custom defined contexts

FIXME comment on aliases

=head3 variables

Like most shells zoid mixes the use of it's own variables with the use of environment
variables. You can use the C<export> builtin to move variables from the perl namespace
to the environment.

=head3 mode

While in normal use zoid tries to determine which context a statement belongs to
automaticly there are also situations in which you want to force one context for all 
commands. In these cases you can set the 'mode' of the shell. The "mode" builtin
is provided to do this a little more intelligent.

For example the CPAN plugin provides an interactive interface to the CPAN::Shell module.

	# enter cpan mode
	zoid$ mode cpan
	zoid$ i /Zoidberg/
	# use a "normal" shell command
	zoid$ !df -h /
	zoid$ install Bundle::Zoidberg
	# return to the "normal" mode
	zoid$ mode -

Modes can be either the name of a custom context (probably defined by a plugin),
or the name of a perl module (matching a '::').
If the mode is a module name all commands are mapped to methods in that namespace;
in this case you can postfix the module name with '->' if the module expects the
class name as first argument to all calls.

	# set mode the hard way
	zoid$ mode CPAN::Shell->
	zoid$ i /Zoidberg/
	zoid$ mode -

=head3 Examples

Some system command:

	zoid$ mplayer -vo sdl -ao sdl my_favorite_movie.avi

Perl code between brackets:

	zoid$ { print "This is perl code." }

A subroutine call to an object loaded in Zoidberg, 
perl code with a little source filtering:

	zoid$ ->Help->help
	 -or-
	zoid$ ->Help->help('objects')

A builtin command:

	zoid$ cd ..

A custom syntax (SQL) enforced on a block:

	zoid$ sql{ SELECT * FROM users WHERE clue > 0 }

And as said all of these can be combined:

	zoid$ cd /usr/local && { print "This is perl code." } | less || sql{SELECT * FROM users WHERE clue > 0}

This will first execute C<cd /usr/local>, on succes followed by C<{ print "This is perl code." } | less>
and if one of these failed we get to see the result of C<< sql{SELECT * FROM users WHERE clue > 0} >>

This makes the precedence of this example as follows.

	( ( 1 and ( 2 pipe 3 ) ) or 4 )

	1 = cd /usr/local
	2 = { print "This is perl code." }
	3 = less 
	4 = sql{SELECT * FROM users WHERE clue > 0}

=head2 Notes

(random notes that probably belong elsewhere in this document)

Files starting with a '-' are ignored in globs unless the glob starts with a '-', this is to
prevent globs from accidentally adding switches to a command.

=head1 ENVIRONMENT

The variables $PWD, $HOME and $USER are set to default values if not
yet set by the parent process.

The variable $ZOID will point to the location of the zoid executable,
it is similar to $SHELL for POSIX compliant shells. zoid uses a differ-
ent variable because some programs seem to expect $SHELL to point to a
POSIX compliant shell.

To switch off ansi colours on the terminal set $CLICOLOR to 0 (null).

The variable $RS (record seperator) is used to split lines when 
capturing ouput from a command in list context.
It defaults to the newline character.

The variable $IFS (input field seperators) is used to split words after
several expansions. It defaults to C<< <space><tab><return> >>.

This list probably isn't complete.

=head1 FILES

Zoidberg uses rc files, data files and plugin files, use the --config
switch to check the search paths used.

Which rcfiles are loaded is controlled be the 'rcfiles' and 'norc' set-
tings, try "zoid -o norc" to skip all rcfiles or "zoid -o
rcfiles=file1:file2:file3" to use files other then the default.

The runtime search path for plugins etc. can be controlled with the
'data_dirs' setting, try "zoid -o data_dirs=dir1:dir2:dir3".


=head1 SEE ALSO

L<zoidbuiltins>(1), L<zoiddevel>(1), L<zoidfaq>(1), L<perl>(1), 
L<http://github.com/jberger/Zoidberg>



( run in 0.408 second using v1.01-cache-2.11-cpan-7f9471e7e0a )