QShell: echo displays nothing - IBM AS400

This is a discussion on QShell: echo displays nothing - IBM AS400 ; I am starting to use QShell (because I am doing some Java experiments). When I enter the command 'echo $classpath', a blank line is returned. When I enter 'echo classpath' (just to test) the word classpath is returned (as expected). ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: QShell: echo displays nothing

  1. QShell: echo displays nothing

    I am starting to use QShell (because I am doing some Java experiments).
    When I enter the command 'echo $classpath', a blank line is returned.
    When I enter 'echo classpath' (just to test) the word classpath is
    returned (as expected). Thus, the following is displayed.

    > echo $classpath


    $
    > echo classpath

    classpath
    $

    I have done some experiments with running a small Java program. The
    program runs ok, even though I am located in another directory than the
    directory where the class file is located. Thus, the classpath seems to
    be set correctly, but I just can't see it.

    Other environment variables (returned by executing the WRKENVVAR
    command) are displayed correctly.

    Does anyone have a clue?

    By the way: where can I find a list of all 'environment variables' that
    can be displayed by using the $-prefix?

    Ewout


  2. Re: QShell: echo displays nothing

    Ewout schreef:
    > I am starting to use QShell (because I am doing some Java experiments).
    > When I enter the command 'echo $classpath', a blank line is returned.
    > When I enter 'echo classpath' (just to test) the word classpath is
    > returned (as expected). Thus, the following is displayed.
    >
    >> echo $classpath

    >
    > $
    >> echo classpath

    > classpath
    > $
    >
    > I have done some experiments with running a small Java program. The
    > program runs ok, even though I am located in another directory than the
    > directory where the class file is located. Thus, the classpath seems to
    > be set correctly, but I just can't see it.
    >
    > Other environment variables (returned by executing the WRKENVVAR
    > command) are displayed correctly.
    >
    > Does anyone have a clue?
    >
    > By the way: where can I find a list of all 'environment variables' that
    > can be displayed by using the $-prefix?
    >
    > Ewout
    >

    This would indicate that variable classpath has not been defined in the
    environment. Any set variable should be able to be echoed with echo
    $. I expect is case sensitive. Under Unix, commands
    set and/or env will list all your environment variables. Not at my box
    right now, but you could give it a try.

    --
    Vriendelijke groeten / Best regards,

    RenÚ H. Hartman
    www.hac-maarssen.nl

  3. Re: QShell: echo displays nothing

    "Ewout" writes:

    > I am starting to use QShell (because I am doing some Java experiments).
    > When I enter the command 'echo $classpath', a blank line is returned.
    > When I enter 'echo classpath' (just to test) the word classpath is
    > returned (as expected). Thus, the following is displayed.
    >
    > > echo $classpath

    >


    Use $CLASSPATH instead. Java cares about case.
    --
    Thorbj°rn Ravn Andersen

  4. Re: QShell: echo displays nothing

    RenÚ, Thorbjoern,

    Thank you both for your reply. Using upper case (i.e. echo $CLASSPATH)
    indeed did the job. And using the command ENV showed me all the
    environment variables.

    One more question: when I changed CLASSPATH using CHGENVVAR, and then
    started a QShell session, the new classpath was returned. I did not
    have to do an 'export classpath'. What exactly is the purpose of the
    export-command?

    Ewout


  5. Re: QShell: echo displays nothing

    "Ewout" writes:

    > One more question: when I changed CLASSPATH using CHGENVVAR, and then
    > started a QShell session, the new classpath was returned. I did not
    > have to do an 'export classpath'. What exactly is the purpose of the
    > export-command?


    The export command makes a variable assignment visible to processes
    and subshells started from this shell. Otherwise it is local to this
    shell.

    In other words the export only changes in memory, and not in the
    permanent storage. Apparently CHGENVVAR does this.

    --
    Thorbj°rn Ravn Andersen

  6. Re: QShell: echo displays nothing

    On Wed, Nov 29, 2006 at 07:08:53PM +0100, Thorbjoern Ravn Andersen wrote:
    > "Ewout" writes:
    > > > echo $classpath

    > >

    >
    > Use $CLASSPATH instead. Java cares about case.


    It is not Java, in this case, that cares about case, it's the QSH.


    Sebastian
    --
    signature intentionally left blank

  7. Re: QShell: echo displays nothing

    Sebastian Schmidt writes:

    > > Use $CLASSPATH instead. Java cares about case.

    >
    > It is not Java, in this case, that cares about case, it's the QSH.


    The JVM looks for the CLASSPATH variable, not the classpath variable.

    In order to set this variable in any Unix shell (including qsh) you
    must refer to CLASSPATH instead of classpath.
    --
    Thorbj°rn Ravn Andersen

+ Reply to Thread