Over the past few days I took some time to work on a project I had in mind for ages, a scripting alternative to Bash: let me introduce you to the ABS programming language.
Let me keep this brief: we all love shell programming — automating repetitive tasks without too much effort.
We might probably agree that shell programming is also kind of nuts in terms of syntax:
1 2 3
Like, ehm, what the hell? fi? -z? brackets?
Fighting with Bash, or the common shell programming language, can get intense from time to time. Writing code such as:
1 2 3
will bring tears to your eyes if you’re using the shell.
Imagine you could run code like:
1 2 3 4 5
Well, you don’t have to “imagine” no more: ABS is a language that combines quick and simple system commands with a more elegant syntax.
Think of it as the best thing since candy, only to remember this is the definition ABS’ author gave you. But seriously, it’s pretty darn convenient.
Don’t believe me? Read on!
I’m a firm believer in the “show me the code!” mantra, so let’s quickly get to it. Running shell commands is extremely easy in abs:
and pipes work too:
At this point we can just capture the output of our command and script over it:
1 2 3 4 5 6 7
It won’t happen, but let’s say that an error happens:
1 2 3 4 5 6 7 8 9 10 11
We could make this a bit more general:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Now, strings are fairly boring, so we can try something more fun:
1 2 3 4 5 6 7 8 9 10
…and so on. There are loads of “regular” things you can do with ABS, so I won’t focus much on those — let me show you the weirder parts instead:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
What’s going to happen now?
The braver ones will just:
(you might need to sudo right before that)
Which one will you be?