RSystem Idea

New Shell

First idea is to use only one pipe character by introducing the ec, pc, cc, epc and ecc tools and partially detect when to use them. It is choosen because it looks like an arrow which is a better visual representation of the operation.

The echo content program is ec, which reads the given Files and prints their content to the output. When no argument is given, it reads from the input. The put content program is pc, which reads from the input and writes the result to the given Files. When no argument is given, it writes to the output. The concat content program is cc, which reads from the input and appends the given Files with them. When no argument is given, it writes to the output. The epc is the echo and put content program. The ecc is the echo and concat content program.

Every input would be evaluated pipe-by-pipe the fallowing way: When the begining word is a function or a command in the path, then it would be called, otherwise the line would be handled by ec, epc or pc. In special cases the user could use these manually.

Example

input.txt > tool > second.txt > head -n 5 > out.txt

1 input.txt not a function
2 input.txt not a commant
3 run ec input.txt instead

k + 1 second.txt not a function
k + 2 second.txt not a command
k + 3 run epc second.txt instead

n + 1 out.txt not a command
n + 2 out.txt not a function
n + 3 run pc out.txt instead

Scripting

Scripting features should be more familiar and natural to the programmer than the ones given by todays popoular shells. Basically the shell should also be a powerful scripting language.

foo = 10

bar = foo + 5

baz(x) {
	return x + 10
}

for(x in 0 .. bar) {
	echo baz(x)
}

Library

A library should also be provided to give developers the ability to integrate the shell and the scripting into their applications. Shell instaces could be set up to act only as scripting languages. Binding native functions and data conversion should be easy.

Shell foo;

foo.cd(path);

foo.mkdir(path);
foo.rmdir(paht);

foo.cp(one, two);
foo.mv(one, two);

File bar = foo.open(path);

bar.write(content);
bar.append(content);

foo.close(path);

File baz = foo.get(path);

baz.open();
baz.close();

foo.execute(command);