Scsh (a ''Scheme shell'') is computer
software
Software is a set of computer programs and associated software documentation, documentation and data (computing), data. This is in contrast to Computer hardware, hardware, from which the system is built and which actually performs the work.
...
, a type of
shell
Shell may refer to:
Architecture and design
* Shell (structure), a thin structure
** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses
** Thin-shell structure
Science Biology
* Seashell, a hard o ...
for an
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
. It is a Portable Operating System Interface (
POSIX
The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines both the system- and user-level application programming inter ...
)
application programming interface (API) layered on the programming language
Scheme, in a manner to make the most of Scheme's ability for
scripting. Scsh is limited to
32-bit platforms but there is a development version against the latest
Scheme 48
Scheme 48 is a programming language, a dialect of the language Scheme, an implementation using an interpreter which emits bytecode. It has a foreign function interface for calling functions from the language C and comes with a library for reg ...
that works in
64-bit
In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit CPUs and ALUs are those that are based on processor registers, address buses, or data buses of that size. A compu ...
mode. It is
free and open-source software released under the
BSD-3-Clause license.
Features
Scsh includes these notable features:
*
Library
A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
support for list, character, and
string manipulations;
*
Regular expression
A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
s manipulation support using ''scheme regular expressions'', a
domain-specific language (DSL), or little languages, approach to the abilities;
* Strong networking support;
* High-level support for
awk
AWK (''awk'') is a domain-specific language designed for text processing and typically used as a data extraction and reporting tool. Like sed and grep, it is a filter, and is a standard feature of most Unix-like operating systems.
The AWK lang ...
like scripts, integrated into the language as
macros;
* Abstractions supporting
pseudo terminal
In some operating systems, including Unix and Linux, a pseudoterminal, pseudotty, or PTY is a pair of pseudo-device endpoints (files) which establish asynchronous, bidirectional communication ( IPC) channel (with two ports) between two or more pr ...
s;
* A
shell
Shell may refer to:
Architecture and design
* Shell (structure), a thin structure
** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses
** Thin-shell structure
Science Biology
* Seashell, a hard o ...
language, modeled using
quasi-quotation
Quasi-quotation or Quine quotation is a linguistic device in formal languages that facilitates rigorous and terse formulation of general rules about linguistic expressions while properly observing the use–mention distinction. It was introduced ...
.
Example
* Print a list of all the executables available in the current
PATH
A path is a route for physical travel – see Trail.
Path or PATH may also refer to:
Physical paths of different types
* Bicycle path
* Bridle path, used by people on horseback
* Course (navigation), the intended path of a vehicle
* Desire p ...
to the
standard output
In computer programming, standard streams are interconnected input and output communication channels between a computer program and its environment when it begins execution. The three input/output (I/O) connections are called standard input (stdin ...
:
#!/usr/local/bin/scsh -s
!#
(define (executables dir)
(with-cwd dir
(filter file-executable? (directory-files dir #t))))
(define (writeln x) (display x) (newline))
(for-each writeln
(append-map executables ((infix-splitter ":") (getenv "PATH"))))
"Acknowledgments"
The reference manual for Scsh includes a spoof
Acknowledgments section
written by Olin Shivers. It starts:
:''Who should I thank? My so-called "colleagues", who laugh at me behind my back, all the while becoming famous on my work? My worthless graduate students, whose computer skills appear to be limited to downloading bitmaps off of netnews? My parents, who are still waiting for me to quit "fooling around with computers," go to med school, and become a radiologist? My department chairman, a manager who gives one new insight into and sympathy for disgruntled postal workers?''
and concludes with:
:''Oh, yes, the acknowledgements. I think not. I did it. I did it all, by myself.''
See also
*
Unix shell
A Unix shell is a command-line interpreter or shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language, and is used by the operating syste ...
*
Comparison of command shells
A command shell is a command-line interface to interact with and manipulate a computer's operating system.
General characteristics
Interactive features
Background execution
Background execution allows a shell to run a command without us ...
References
External links
*
*
Sourceforge project page
Unix shells
Scheme (programming language) interpreters
Scheme (programming language) implementations
Scripting languages
Software using the BSD license
{{Unix-stub