|
|
Subscribe / Log in / New account

The Squirrel portable shell and scripting language (developerWorks)

The Squirrel portable shell and scripting language (developerWorks)

Posted Mar 19, 2009 14:54 UTC (Thu) by Tuxie (guest, #47191)
Parent article: The Squirrel portable shell and scripting language (developerWorks)

Personally I think it's stupid to call it a "shell", because it doesn't have any shell semantics like simple pipes, redirections and job control, and to run the external program foo you have to write run("foo"). This is just yet another scripting language like ruby/perl/python, and a pretty bad one at that (IMHO).

How do you do the following typical shell-pattern in Squirrel?
cat /tmp/foo*.txt | grep -v ^bar | sed 's:foo:bar:g' | myprogram


to post comments

The Squirrel portable shell and scripting language (developerWorks)

Posted Mar 20, 2009 9:48 UTC (Fri) by odie (guest, #738) [Link] (1 responses)

Quoting the Squirrel shell manual:

"Squirrel Shell 1.0rc2 and newer support input, output and error streams redirection for child processes."

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:
sed '/^bar/ ! s:foo:bar:g' /tmp/foo*.txt | myprogram

The Squirrel portable shell and scripting language (developerWorks)

Posted Mar 21, 2009 22:46 UTC (Sat) by mp (subscriber, #5615) [Link]

I believe your variant does something noticeably different.
Next time, try:
sed '/^bar/d; s:foo:bar:g'


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds