Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charlie5/aShell
A component to aid in writing shell-like applications in Ada.
https://github.com/charlie5/aShell
Last synced: 2 months ago
JSON representation
A component to aid in writing shell-like applications in Ada.
- Host: GitHub
- URL: https://github.com/charlie5/aShell
- Owner: charlie5
- License: other
- Created: 2016-10-27T07:24:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-01T11:34:53.000Z (9 months ago)
- Last Synced: 2024-02-01T20:13:25.496Z (5 months ago)
- Language: Ada
- Size: 1.08 MB
- Stars: 12
- Watchers: 6
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-ada - a-shell - A component to aid in writing shell-like applications in Ada. (Applications / Shells, Interpreters and Emulators)
- awesome-ada - a-shell - A component to aid in writing shell-like applications in Ada. (Applications / Shells, Interpreters and Emulators)
README
# aShell
[![Alire](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/ashell.json)](https://alire.ada.dev/crates/ashell.html)A component to aid in writing shell-like applications in Ada.
Under an ISC license.
## Install
Add the following lines to your ~/.bashrc or equivalent ...```shell
ASHELL=/path/to/ashell/rootexport GPR_PROJECT_PATH=$ASHELL/library:$GPR_PROJECT_PATH
```Alire is supported.
## Example
```ada
declare
use Shell.Commands;
Output : constant String := +Output_Of ("ps -A | grep bash | wc");
begin
Put_Line (Output);
end;
```This will produce output similar to ...
14 56 434
## ExampleA trivial shell script:
```shell
#! /bin/sh
tr '\000' '\n' | ds_harmonize
```Might be written like this in Ada:
```ada
with Shell;
procedure SDS_to_DS is
DS_Pipe : Shell.Pipe;
Zero_To_Newline : Shell.Process := Start (Program => "tr",
Arguments => (+"\000", +"\n"),
Output => DS_Pipe);
DS_Harmonize : Shell.Process := Start (Program => "ds_harmonize",
Input => DS_Pipe);
begin
null;
end SDS_to_DS;
```