bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] strange behavior of --


From: enztec
Subject: Re: [Bug-apl] strange behavior of --
Date: Fri, 3 Feb 2017 17:50:15 -0700

personally i would rather have the   -- in the script being observed rather 
then having to do it like    ./script -- arg1 arg2
should be consistent with how other scripting languages handle command line 
arguments/parameters


On Fri, 03 Feb 2017 23:06:38 +0100
Alexey Veretennikov <address@hidden> wrote:

> Hi,
> 
> Yes ./script -- myarg works.
> 
> The problem is why I have to repeat -- in command line since I've
> already specified it in the first line of the script, as it is specified
> in documentiation.
> 
> Basically I would like to pass my arguments to the script without
> mentioning "--" in the command line.
> 
> Juergen Sauermann <address@hidden> writes:
> 
> > Hi Alexey,
> >
> > how about this:
> >
> > address@hidden:~/tmp$ ./script -- arg**
> > **DUMPED 2017-01-28 22:57:44 (GMT+1)**
> > **┌→────────────────────────────────────────────────────┐**
> > **│┌→─────────────────┐ ┌→───────┐ ┌→───────┐ ┌→─┐ ┌→──┐│**
> > **││/usr/local/bin/apl│ │--script│ │./script│ │--│ │arg││**
> > **│└──────────────────┘ └────────┘ └────────┘ └──┘ └───┘│**
> > **└∊────────────────────────────────────────────────────┘*
> >
> > There is no point (and it does not work) to put the arguments in the first 
> > line
> > of the script,
> > because if the script itself knows them then the rest of the script can use 
> > them
> > as well.
> >
> > *⎕ARG *is what is passed to the script, not what is passed to the 
> > interpreter
> > mentioned in the script.
> > See also *man execve*.
> >
> > /// Jürgen
> >
> >
> > On 02/03/2017 08:29 PM, Alexey Veretennikov wrote:
> >> Given the following script:
> >> ------------------------------------------
> >> #!apl --script --
> >> )copy 5 FILE_IO FIO∆errno
> >> 8⎕CR ⎕ARG
> >> )off
> >> ------------------------------------------
> >> when I try to run it like
> >>
> >> ./script.apl myarg
> >>
> >> I get the error:
> >>
> >> /script.apl myarg
> >> unknown option 'myarg'
> >> ...
> >>
> >> This happens on 833 and 1.5 and on both linux and osx.
> >>
> >> In INFO file it explicitely states:
> >>
> >> "Using ’—-’ as last argument on the first line of the script file
> >> prevents any of the options given to the script to be interpreted as APL
> >> options; all such options are passed to the application via ⎕ARG."
> >>
> >> But it is not happening.
> >>
> >>
> >>
> >
> 
> -- 
> Br,
> /Alexey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]