Re: Command linearg puzzle
Posted in 1996
You don't cite platform or version information, which generally makes life more difficult to diagnose problems... However, in this case, we can state categorically that there is no way for any Unix program initiated by the shell to see the command line as typed by the user. Therefore, those quotes did not get there by any normal mechanism. Now, if you were in fgldb, then quotes (probably double) would be added around the value in a print statement. In fglgo, I don't see how the code would ever put the single quotes there without manual intervention. You can experiment with an I4GL variant of 'echo': MAIN DEFINE i INTEGER DEFINE n INTEGER DEFINE a CHAR(60) LET n = NUM_ARGS() FOR i = 1 TO n STEP 1 LET a = ARG_VAL(i) DISPLAY a END FOR END MAIN This will show you what ARG_VAL() is returning... Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >From: johnb@inforamp.net (John Beaudin) >Date: Wed, 13 Mar 1996 03:27:26 GMT >X-Informix-List-Id: <news.24609> > >I was executing, using the Korn shell, the following command line: > >fglgo foo.4gi 'JB*' > >I was amazed to learn that the program detected the single quotes. I was >able to display the arg from the 4gl program and saw (the quotes are not >being added by the source code) > > 'JB*' > >using something like > > display arg > >Is the program able to see its whole command line, as opposed to using the >'argv, argc' features of the C library? > >If no, then how could this happen? I assumed that the shell hid quotes from >programs, when they ask for their arguments.