*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Wed, 14 Jun 2017 15:12:40 +0200
changeset 1510 328cf54d3850
parent 1509 f339eb9c0672
child 1511 23747ef6caa2
*** empty log message ***
script0.stx
script4.stx
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/script0.stx	Wed Jun 14 15:12:40 2017 +0200
@@ -0,0 +1,17 @@
+#!stx --script
+
+"/ shows command line arguments
+"/
+"/ run with:
+"/   ./stc --script script0.stx one two three
+"/ or:
+"/   chmod +x stcript0.stx
+"/   ./stscript0.stx one two three
+
+'Command line arguments:' printCR.
+'_$0: ' print. _$0 printCR.
+'_$n: ' print. _$n printCR.
+1 to: _$n do:[:idx |
+   ('_$',idx asString,': ') print. (_$$ at:idx) printCR.
+].
+'_$$: ' print. _$$ printCR.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/script4.stx	Wed Jun 14 15:12:40 2017 +0200
@@ -0,0 +1,29 @@
+#!stx --script
+"/
+"/ on any system:
+"/      "stx --script script1.stx
+"/ or:
+"/      "stx --f script.stx"
+"/ or:
+"/      "stx script1.stx"
+"/
+"/ on Unix:
+"/      make this file executable,
+"/      ensure that stx is in your path,
+"/      then type ./script1.stx
+"/
+"/ will just print some numbers
+"/
+
+"/ Stderr showCR:Workspace workspaceVariableNames.
+"/ Stderr showCR:Workspace workspaceVariables.
+
+_$n == 1 ifFalse:[
+    Stderr showCR:('usage: ',_$0,' <n>').
+    Smalltalk exit:1.
+].
+
+1 to:(_$1 asInteger) do:[:i |
+   ('the factorial of %1 is %2'
+	bindWith:i with:i factorial) printCR
+].