【发布时间】:2014-01-21 03:08:36
【问题描述】:
Berkeley Logo 用户手册告诉我们,hypen 之后的所有命令行参数都将被收集到变量中:
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.
我试了一下,还是不行:
$ cat test.lg
#!/usr/bin/logo -
print :COMMAND.LINE
$ ./test.lg
I can't open file -
?
有什么想法吗?
我使用 Ubuntu 软件包中的 ucblogo 5.5-2.1。
【问题讨论】: