| Did you know ... | Search Documentation: |
| Packs (add-ons) for SWI-Prolog |
| Title: | Unix to Prolog shell. |
|---|---|
| Rating: | Not rated. Create the first rating! |
| Latest version: | 3.0 |
| SHA1 sum: | 6a91d3afc1f08ae8a065e562f3be9e056cb1aeba |
| Author: | Nicos Angelopoulos http://stoics.org.uk/~nicos |
| Maintainer: | Nicos Angelopoulos http://stoics.org.uk/~nicos |
| Packager: | Nicos Angelopoulos http://stoics.org.uk/~nicos |
| Home page: | http://stoics.org.uk/~nicos/sware/upsh |
| Download URL: | http://stoics.org.uk/~nicos/sware/packs/upsh/upsh-*.tgz |
No reviews. Create the first review!.
| Version | SHA1 | #Downloads | URL |
|---|---|---|---|
| 3.0 | 6a91d3afc1f08ae8a065e562f3be9e056cb1aeba | 1 | https://stoics.org.uk/~nicos/sware/packs/upsh/upsh-3.0.tgz |
| 2.6 | f3dccfdbe21493b18b63dc6b366d7b200204462e | 5 | https://stoics.org.uk/~nicos/sware/packs/upsh/upsh-2.6.tgz |
| 2.5 | 3574fbd405211b77c06dee261567a42101fe0332 | 22 | http://stoics.org.uk/~nicos/sware/packs/upsh/upsh-2.5.tgz |
| 2.4 | 21a417c6166047e800589a08b0b98a5a1fbf48df | 5 | http://stoics.org.uk/~nicos/sware/packs/upsh/upsh-2.4.tgz |
| 2.3 | ed80d168b9939281bf0772a84e30254cc6402fb9 | 2 | http://stoics.org.uk/~nicos/sware/packs/upsh/upsh-2.3.tgz |
| 2.2 | b8505f9d60ad658352cbc1efae15fd8085390cb1 | 1 | http://stoics.org.uk/~nicos/sware/packs/upsh/upsh-2.2.tgz |
| 2.1 | 9cc904776b919c1033b3e9ac24a2c5a36bf1b49f | 3 | http://stoics.org.uk/~nicos/sware/packs/upsh/upsh-2.1.tgz |
To install within SWI-Prolog, do:
?- pack_install(upsh).
This should automatically create executable state 'upsh' in same directory as swipl. The executable can also be created with
?- use_module(library(upsh)). ?- upsh_make.
With this Prolog scripts can be ran from the command line:
> upsh say naku % /home/nicos/.rcpl compiled 0.00 sec, 8 clauses % /home/nicos/bin/cline_upsh/say.pl compiled 0.00 sec, 5 clauses naku > upsh v upsh_exec(upsh(3:0:0),swi(10:1:4),built_on(2026/3/9,17:1:58))
Upsh will look for scripts in
Where PACK as an SWI Prolog installed pack.
> upsh say a=b,c % /home/nicos/pl/packs/src/upsh/scripts/say.pl compiled 0.00 sec, 6 clauses a(b,c)
Will run the the script say.pl distributed with pack(upsh).
To get a brief help message
> upsh h
Currently is known to work with anything later than : SWI (7.0.0)
Previous upsh versions also ran on YAP and SICStus
The syntax for command line invocation is
> upsh [upsh flags] Program [-] [Arguments]
Upsh is quite flexible in that the order of those elements can be fluid. Any one letter flag is taken to be an upsh flag, the first prolog file to be the Program and remainders to be Arguments to be passed to Program. To enforce strict separation use '-'.
The following options are the main upsh flags.
Upsh, comes with two examples, say.pl and alert.pl which can be found in directory scripts/ . 'say' simply spews out its input arguments one at the time.
Program alert.pl is a more evolved example that demonstrates
how upsh can be used in conjuction with other stoics packs (https://stoics.org.uk/~nicos/sware/packs),
specifically pack(options), pack(by_unix) and pack(debug_call).
Normally any progam argument of the form isnogood translates to is(no(good))).
Below are examples of upsh usage, particularly in relation to passing arguments
% upsh say hello=world % /home/nicos/pl/packs/src/upsh/scripts/say.pl compiled 0.00 sec, 6 clauses hello(world) % upsh p say hello world a=b,c hello world a(b,c) % upsh say n=who,1 bye Upsh cannot locate in memory suitable entry-goal given by n/2 argument. In your Prolog script define one of: [who/1] [who/1] % upsh p say a=lst=b,c x==y k\\=m a([b,c]) x=y k=m % % upsh say o - a=b,c 'a=b,c'
The main documentation is the comments in the module definition (upsh/prolog/upsh.pl).
To see it in your local web-browser
> swipl -f none ... ?- doc_server(4000). % Started server at http://localhost:4000/pldoc/ true. ?- use_module(library(upsh)). 3 ?- doc_browser.
And search for upsh.
The html of the latest version is at: https://stoics.org.uk/~nicos/sware/upsh/doc/html/upsh.html
The home page of project is at https://stoics.org.uk/~nicos/sware/upsh
Upsh is released under the MIT licence.
To contact the author with examples of how you use upsh and comments about the software see details in: https://stoics.org.uk/~nicos/sware/contact.html
Nicos Angelopoulos https://stoics.org.uk/~nicos, April 2004 - March 2026 Made into a pack May 2016.
Pack contains 62 files holding a total of 702K bytes.