Anonymous user
User defined pipe and redirection operators: Difference between revisions
User defined pipe and redirection operators (view source)
Revision as of 12:34, 13 September 2011
, 12 years agoFor bonus Kudos: Implement the shell "&" concept as a dyadic operator in the specific language.
m (moved Define pipe and redirection operators to User defined pipe and redirection operators: Objective of the task to to see if this is achievable, or can be closely achieved in a specific languages.) |
(For bonus Kudos: Implement the shell "&" concept as a dyadic operator in the specific language.) |
||
Line 9:
If the language supports operator definition, then:
* create "user defined" the equivalents of the Unix shell "<", "|", ">", "<<", ">>" and $(cmd) operators.
* Provide simple equivalents of: cat, tee, grep, uniq, wc, head & tail, but as filters/procedures native to the specific language.
* Replicate the below sample shell script, but in the specific language
* Specifically ''do not'' cache the entire stream before the subsequent filter/procedure starts. Pass each record on as soon possible running all filters/procedures concurrently.
For bonus Kudos: Implement the shell "&" concept as a dyadic operator in the specific language. e.g.: <lang sh>( head x & tail x & wait ) | grep test</lang>
'''Alternately:''' if the language does not support operator definition then replace with:
Line 18 ⟶ 21:
'''Sample shell script:''' ''¢ draft - pending a better (more interesting) suggestion ¢''
<lang sh>aa="$(
(
head -4 < List_of_computer_scientists.lst;
Line 27 ⟶ 29:
);
echo "Pioneer: $aa"
</lang>
'''Input File:'''
|