Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to catch command line arguments in Berkley Logo (UCBLogo)?

Berkeley Logo User Manual tells that all command line arguments after a hypen will be collected in the variable:

If a command line argument is just a hyphen, then all command line arguments
after the hyphen are not taken as filenames, but are instead collected in a
list, one word per argument; the buried variable COMMAND.LINE contains that
list of arguments, or the empty list if there are none.  On my Linux system,
if the first line of an executable shell script is
#!/usr/local/bin/logo -
(note the hyphen) then the script can be given command line arguments and
they all end up in :COMMAND.LINE along with the script's path.  Experiment.

I try it, and it doesn't work:

$ cat test.lg
#!/usr/bin/logo - 
print :COMMAND.LINE

$ ./test.lg 
I can't open file -
? 

Is there any ideas what's wrong?

I use ucblogo 5.5-2.1 from Ubuntu packages.

like image 275
tse Avatar asked Jan 01 '26 00:01

tse


1 Answers

Berkeley Logo 5.5 does not support parsing of command line arguments from a script.

The User Manual you quoted is for Berkeley Logo version 6. You should be able to use command line arguments just like that using ucblogo-6.0.

You can download Berkeley Logo 6.0 from http://www.eecs.berkeley.edu/~bh/

like image 181
Juan Cespedes Avatar answered Jan 06 '26 11:01

Juan Cespedes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!