Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

command line stuff

 [1/3] from: notofo::earthlink::net at: 5-May-2004 9:02


Hey guys, I'm pretty sure this has been covered before, but I couldn't remember it, and a search couldn't find it. if I have a script, say, blap.r, that has a function, a: func['b 'c] ["blah" "blah"] how can I, from bash (my shell) execute something like, $ blap.r b c -- -tom -- signature in pain: "ouch!" -tom

 [2/3] from: antonr:lexicon at: 6-May-2004 1:36


Within the blap.r script, probe these: system/script/args system/options/args You should see your command line strings b and c there. As for getting output back into the shell, um... you might have to call an external program to show your output. ie something like: call join "cat " mold your-output-string Anton.

 [3/3] from: greggirwin:mindspring at: 5-May-2004 11:56


Hi Tom, TF> if I have a script, say, blap.r, that has a function, TF> a: func['b 'c] ["blah" "blah"] TF> how can I, from bash (my shell) execute something like, TF> $ blap.r b c Put a shebang line at the top of your script, including the -c option to tell REBOL to run in CGI mode, then just PRINT your results. Anton's advice about looking at both ways args come in is really good, so, to build on that... #! /usr/bin/rebol -c REBOL [] test-fn: func [value][print ["The value given was:" mold value]] test-fn system/script/args test-fn system/options/args Of course, you don't need to define the function; you can just do this: print ["The value given was:" mold system/options/args] HTH! -- Gregg