[jamming] jam shell
Mildred
ml.mildred593 at online.fr
Wed Nov 7 18:18:04 PST 2007
Hi,
I just spent 5 hours modifying ft-jam to create a jam-shell. It is a
shell language (not meant to be used interactively, only in scripts).
Actually it is very basic, but promising from my point of view.
Basicly, I just removed the 'actions' statement and the execution of
the actions after rules are parsed. Unknown rules are understood as
external program invocation, and few builtins rules were added.
special variables:
$(...) arguments to the script
$(?) return status of the last command
$(!) pid of the last command run in background
Special rules:
Ex command line ;
Execute the "command" program with the parameter
"line". It is used to be able to call programs that
have the same name as builtins rules.
Export variable := value ;
Export the variable named "variable" to the environment
giving the value "value". Force the assignment.
Export variable ?= value ;
Export the variable named "variable" to the environment
giving the value "value". If the variable already
exists in the environment, it is not erased.
Export variable =! ;
Export variable ;
Delete the variable named "variable" from the
environment.
The following rules have been kept from Ft-Jam:
Echo, Exit, Glob, Match, Command, Split
It is possible to run a command in background with the following syntax:
command arg1 arg2 : "&" ;
or Ex command arg1 arg2 : "&" ;
What should come next :
read from the terminal (read)
wait for childs (started with "&")
redirect std{in,out,err} of commands
modify environment variables on command invocation (execve)
You can see the source code here:
https://code.launchpad.net/~mildred/+junk/jam-shell
Do you think it is a good idea ? My main motivation for that was to get
rid of the wwierd variable expansion of sh and compatible shell that
forces you to write "$var" (in quotes) to be shure that spaces in the
variable won't split the argument of the command. Moreover i like the
Jam language so much that i thought I had to do something like that.
And it was easy.
Enough for now, it is 3 AM ... good night
Mildred
--
Mildred Ki'lya
E-Mail: mildred593 at online.fr
Site: <http://mildred632.free.fr/>
XMPP: <mildred at jabber.fr> (GoogleTalk, Jabber)
GPG: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]
More information about the jamming
mailing list