Shell from DOS script does not get full PATH information
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Sprocki
    Posts: 128 from 2005/2/23
    From: Berlin - Germany
    Maybe it is related to https://morph.zone/modules/newbb_plus/viewtopic.php?forum=9&topic_id=11373&post_id=121529&viewmode=flat&sortorder=0&showonepost=1 where an executable could not be found in the path, so I link it to this.

    I started a Shell from a DOS script:

    Work:Daten/DA> type open_env.script
    run >nil: SYS:Applications/Scribble/Scribble
    run >nil: RXCmd AMBIENT "loaduri
    Work:Daten/DA?view=List&mode=ALL&top=1800&left=1500&width=500&height=400"
    run >nil: newshell con:/800/600/400/DA


    In this Shell most pathes are not available which leads to many Shell commands not being found, e.g. the command 'wget' is answered as being an 'unknown command'.


    1) PATH in 'local' Shell:

    Work:Daten/DA> path
    Aktuelles_Verzeichnis
    C:


    2) PATH in 'global' Shell:

    Ram Disk:> path
    Aktuelles_Verzeichnis
    System:MorphOS/C
    System:C
    System:Utilities
    System:S
    System:MorphOS/S
    System:Development/GG/bin
    System:Development/GG/usr/bin
    System:Development/GG/usr/local/bin
    System:Development/Tools
    System:Applications/Scribble
    C:


    Why does the first Shell not get any of the PATH information? How can I change the Shell call to get access to all global settings?
  • »08.10.15 - 22:38
    Profile
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    Quote:

    Sprocki wrote:
    Why does the first Shell not get any of the PATH information? How can I change the Shell call to get access to all global settings?


    The path of a new shell comes from its parent.

    If e.g. An application is creating a new shell and the path is wrong, then

    A) The application itself has no proper path
    B) The application actively cuts down the path

    As a path gets handled from parent to child it is also possible that your application got launched before the root shell, which is the shell with the path build in startup sequence, is complete.

    Adding a path has only effect on the current shell and those opened from it.
  • »09.10.15 - 03:56
    Profile