command shell
News
Version 3.1 released on September 5, 2017.Version 3.0 released on August 22, 2017.
Version 2.6 released on June 21, 2013.
Version 2.5 released on July 30, 2012.
Version 2.4 released on June 30, 2011. Introduced configuration script.
Version 2.3 released on April 1, 2011.
Version 2.2 released on January 24, 2011.
Version 2.1 released on September 5, 2010.
Version 2.0 released on May 26, 2010. You will need to make changes to cs_defs.pl if you are upgrading from version 1.x. See the README file for details.
Download
cs.tgz
Description
This script provides a command shell to which you can add your own commands. Initial customization of the script is made using customize.pl. Make additional customizations by editing the xx_defs.pl and xx_impl.pl files that are generated by customize.pl.Detailed instructions for customizing the script and documentation of support routines appears in CommandShell.pdf.
I encourage you to make all your customizations in the xx_defs.pl and xx_impl.pl files unless the main script needs fixing or improvements. In the latter case, please send those changes to me. Please also send me any generic changes you make to xx_defs.pl and xx_impl.pl such as new utility routines that might be useful to all script editors.
The basic script provides three modes of operation:
main | this is the mode to which you will typically add your own commands |
system | execute operating system commands (via system function) |
perl | evaluate perl expressions |
Example
Here is a sample session in a version of the Command Shell without any customization:
./cs.pl main> help e!command Execute a sample <command> !command Execute a system <command> p!statement Execute a Perl <statement> main Process in sample mode system Process in system command mode perl Process in Perl mode edit file Edit <file> with emacs reload Reload this program quit Exit this program main> help system System mode and the ! prefix allow you to execute system commands. main> !ls ChangeLog GPL README cs.pl cs_cgi.pl cs_db.pl cs_defs.pl cs_fn.pl cs_impl.pl cs_local.pl cs_network.pl cs_xml.pl customize.pl lib pdf server main> help perl Perl mode and the p! prefix allow you to execute Perl expressions. main> p!$ENV{EDITOR} /usr/bin/emacs main> exit
Send me reports of any errors or suggestions you have about my Perl scripts.
The code described on this page is Copyright 2004-2017 Tony Lewis <tlewis@exelana.com>.
This program 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.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.