Anonymous user
User defined pipe and redirection operators: Difference between revisions
User defined pipe and redirection operators (view source)
Revision as of 00:38, 13 September 2011
, 12 years agoaugment the sample/example shell script
m (create "user defined" the equivalents of the Unix shell "<", "|", ">", "<<" and ">>" operators.) |
m (augment the sample/example shell script) |
||
Line 8:
'''Task:'''
If the language supports operator definition, then:
* create "user defined" the equivalents of the Unix shell "<", "|", ">", "<<"
* Provide simple equivalents of: cat, tee, grep, uniq, wc, head & tail, but as procedures native to the specific language.
* Replicate the below sample shell script, but in the specific language.
Line 18:
'''Sample shell script:''' ''¢ draft - pending a better (more interesting) suggestion ¢''
<lang sh>
aa="$(
head -4 < List_of_computer_scientists.lst▼
(
cat List_of_computer_scientists.lst | grep ALGOL | tee ALGOL_pioneers.lst▼
▲ cat List_of_computer_scientists.lst | grep ALGOL | tee ALGOL_pioneers.lst;
) | uniq | tee "the_important_scientists.lst" | grep aa</lang>▼
);
echo "Pioneer: $aa"
</lang>
'''Input File:'''
* List_of_computer_scientists.lst - cut from wikipedia.
Line 28 ⟶ 33:
'''Output:'''
<pre>
Pioneer: Adriaan van Wijngaarden - Dutch pioneer; ARRA, ALGOL
</pre>
|