Really Weird Shell - the structural regular expression shell - Programming On Unix

Users browsing this thread: 1 Guest(s)
tudurom
Long time nixers
Here it is!

For the moment it can only execute piped commands, it doesn't even have variables or string substitution, and the only builtin is cd. The main innovation, though, is a special kind of pipe, called The Pizza.

It looks like this:

Code:
dmesg |> ,x/[lL]inux/ c/GNU+Linux/ |> ,p

What the above code is doing is changing all occurrences of "linux" or "Linux" to "GNU+Linux", then printing everything.

One complex example is the following:

Code:
cat text |> ,x/Ben|Dave/ {
    g/Ben/ c/Dave/
    g/Dave/ c/Ben/
} |> ,p | lolcat

This one changes all occurrences of "Dave" to "Ben" and "Ben" to "Dave" in parallel, then prints the whole file in rainbow colors!

This should become more useful after implementing variables, variable substitution and shell substitution. Stay tuned, and share your impressions!

To run it, make sure you have rustc and cargo installed, then run

Code:
cargo run


Messages In This Thread
Really Weird Shell - the structural regular expression shell - by tudurom - 02-05-2019, 02:41 PM