The Squirrel portable shell and scripting language (developerWorks)
If you don't want to commit to the idiosyncrasies of the Fish shell, the Bash shell, the Z shell, the Windows operating system's cmd.exe, or some other shell scripting language, try the Squirrel Shell. The Squirrel Shell provides an advanced, object-oriented scripting language that works equally well in UNIX, Linux, Mac OS X, and Windows systems. You can write a script once and run it anywhere."
Posted Mar 18, 2009 17:17 UTC (Wed)
by danielpf (guest, #4723)
[Link] (4 responses)
Posted Mar 18, 2009 17:25 UTC (Wed)
by atai (subscriber, #10977)
[Link] (3 responses)
Posted Mar 18, 2009 18:36 UTC (Wed)
by tzafrir (subscriber, #11501)
[Link] (2 responses)
I figure that the author had some SQL shell in mind;
There's also some excessive use of ();
exit();
Posted Mar 18, 2009 20:30 UTC (Wed)
by man_ls (guest, #15091)
[Link] (1 responses)
Posted Mar 19, 2009 1:00 UTC (Thu)
by atai (subscriber, #10977)
[Link]
Posted Mar 18, 2009 18:48 UTC (Wed)
by chojrak11 (guest, #52056)
[Link]
Posted Mar 19, 2009 14:54 UTC (Thu)
by Tuxie (guest, #47191)
[Link] (2 responses)
How do you do the following typical shell-pattern in Squirrel?
Posted Mar 20, 2009 9:48 UTC (Fri)
by odie (guest, #738)
[Link] (1 responses)
Quoting the Squirrel shell manual: I believe it is done with variables, but I don't know any Squirrel, so can't comment on whether it's usable or not. Oh, and by the way, I believe there is an award for the kind of blatant overuse of pipes in your example. Next time, try:
Posted Mar 21, 2009 22:46 UTC (Sat)
by mp (subscriber, #5615)
[Link]
The Squirrel portable shell and scripting language (developerWorks)
The Squirrel portable shell and scripting language (developerWorks)
The Squirrel portable shell and scripting language (developerWorks)
Indeed:
Too verbose
> printl( getenv( "HOME" ) );
And this instead of:
$ echo $HOME
2.5 times as many characters. For this level of verboseness I prefer Python instead.
Squirrel Shell isn't much of an interactive shell, but that's okay. There are many alternatives in that category already. Squirrel Shell is far better as a script runner. Its data structures are more capable than a traditional shell, it's syntax is familiar, and its underlying virtual engine supports everything from enumerated types to threads. The Squirrel engine is also tiny, at less than 6000 lines of code. You can even embed all of Squirrel in another application.
To quote the original article,
The Squirrel portable shell and scripting language (developerWorks)
The Squirrel portable shell and scripting language (developerWorks)
cat /tmp/foo*.txt | grep -v ^bar | sed 's:foo:bar:g' | myprogram
The Squirrel portable shell and scripting language (developerWorks)
"Squirrel Shell 1.0rc2 and newer support input, output and error streams redirection for child processes."
sed '/^bar/ ! s:foo:bar:g' /tmp/foo*.txt | myprogramThe Squirrel portable shell and scripting language (developerWorks)
Next time, try:
sed '/^bar/d; s:foo:bar:g'
