[Oberon] Free ride on other systems goes far.
eas lab
lab.eas at gmail.com
Thu Feb 14 11:51:17 CET 2013
My recent discovery that ETH Oberon (2.4.3) for Linux x86
aka LEO, can directly run and display the output of *nix
commands -- provided the command exits: else LEO will
also wait until its decedant exits -- once again shows the
economy of effort gained by riding on other systems.
The economical [in terms of long term effort] attribute of *nix
of being suitable to concatenate functions is show in this
example which would clean-up a USEnet article which had
become badly formatted, like:-
>> some long lines folded unintentionally
> not at
>> the original line boundry.
to give
2> some long lines folded unintentionally
2> not at the original line boundry.
Don't bother to read the actual-tested-HERE-*nix-lines.
Just read the explanations-lines starting with "=>"
=> Use `sed` to remove all leading ">"
System.Execute sed s/">"//g /tmp/SysExcData > /tmp/SysExcData.tmp
=> Use `tr` to replace all <EOL> with space, to create one-long-line
System.Execute cat /tmp/SysExcData.tmp | tr "\012" "\040"
>/tmp/SysExcData.tmp2
=> Use `fmt -u -w 77 ` to format lines with word-break: LineLen < 77
System.Execute fmt -u -w 77 /tmp/SysExcData.tmp2 > /tmp/SysExcData.tmp
=> Use `sed` to prepend <what ever> to all lines; in this case "2>"
System.Execute sed s/^/"2>"/ /tmp/SysExcData.tmp > /tmp/SysExcData.tmp2
System.Execute sed s/^/">"/ /tmp/SysExcData.tmp > /tmp/SysExcData.tmp2
==> this fails ? but:
System.Execute sed s/7/X/ /tmp/SysExcData.tmp
==OK; suspect the "^" char
System.Execute sed s/^/XY/ /tmp/SysExcData.tmp
== also fails
System.Execute sed s/"^"/XY/ /tmp/SysExcData.tmp
== also fails
=> Perhaps LEO can't handle "^"? So put the "^" in a file & tell sed to use
=> <the char in BadChar>, to avoid the need to mention the <badChar> ;
=> a-la PeeCee talk.
System.Execute sed s/`cat BadChar`/XY/ /tmp/SysExcData.tmp
==OK !!
System.Execute sed s/`cat BadChar`/"2>"/ /tmp/SysExcData.tmp >
/tmp/SysExcData.tmp2
==OK ==> /tmp/SysExcData.tmp2 ==
2> shortline1 LongLine2 Use `fmt -u -w 77 ` to make lines: LineLen < 77 Use
2> `fmt -u -w 77 ` to make lines: LineLen < 77 shortline3 LongLine2 Use
2> `fmt -u -w 77 ` to make lines: LineLen < 77 Use `fmt -u -w 77 ` to make
2> lines: LineLen < 77 shortline5
Also, ETHO has already got a scripting sequential-only-language:
ET.Do <File with one Module.Procedure per line, to be executed sequentially>.
So some of the scripting can be moved to the LEO level.
This facility of LEO removes the stress of having to switch between
LEO and various terminals. Now it's all on one screen. I like it.
WDYS?
== Chris Glur.
More information about the Oberon
mailing list