malagoli@MHD.UCHICAGO.EDU (Andrea Malagoli) (06/08/89)
It seems to me that when I start a wsh with the option -c (command) a different path is used other than the one I define in my .cshrc file. Sometimes, wsh is unable to run the command and exits. Can someone explain to me how does wsh define its path to look for any command? And how can I modify it? Andrea Malagoli University of Chicago malagoli@mhd.uchicago.edu
kipp@warp.wpd.sgi.com (Kipp Hickman) (06/08/89)
In article <8906072129.AA01398@mhd.uchicago.edu>, malagoli@MHD.UCHICAGO.EDU (Andrea Malagoli) writes: > It seems to me that when I start a wsh with the option -c (command) > a different path is used other than the one I define in my .cshrc > file. Sometimes, wsh is unable to run the command and exits. > ... > Andrea Malagoli > University of Chicago When you run wsh -c, it inherits its environment from whatever started it. If you start it from your shell, then it will inherit the environment from the shell, and all should be fine and dandy. If you start it from 4sight, then it inherits the environment from 4sight. This is the most common problem, because 4sight is started before your environment is loaded up. A quick-and-dirty solution is to add the following (sample) line to your user.ps in your home directory: (PATH) (/d/kipp/bin:/usr/local/bin:/usr/sbin:/usr/bsd:/usr/bin:/bin:/usr/etc:/etc:/usr/bin/X11:/usr/local/bin/ctools) putenv this does mean you have a copy of the information in your .login/.profile, but thats why its quick-and-dirty. Better yet, is to use the ``exporttonews'' program (I believe its floating around on the net somewhere). kipp
ciemo@bananapc.wpd.sgi.com (Dave Ciemiewicz) (06/08/89)
In article <34885@sgi.SGI.COM>, kipp@warp.wpd.sgi.com (Kipp Hickman) writes: > > When you run wsh -c, it inherits its environment from whatever > started it. If you start it from your shell, then it will inherit > the environment from the shell, and all should be fine and dandy. > > If you start it from 4sight, then it inherits the environment from > 4sight. This is the most common problem, because 4sight is started > before your environment is loaded up. A quick-and-dirty solution > is to add the following (sample) line to your user.ps in your > home directory: > > (PATH) (/d/kipp/bin:/usr/local/bin:/usr/sbin:/usr/bsd:/usr/bin:/bin:/usr/etc:/etc:/usr/bin/X11:/usr/local/bin/ctools) putenv > > this does mean you have a copy of the information in your > .login/.profile, but thats why its quick-and-dirty. Better yet, is > to use the ``exporttonews'' program (I believe its floating around > on the net somewhere). > > kipp > > exporttonews is a script I wrote sometime back that has not been posted to the net (unless someone did it for me :^). Just so you won't go searching for it here it is in shar file form. --- Dave ----- CUT HERE ---------------------------------------------------------------- # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by ciemo on Thu Jun 8 09:44:57 PDT 1989 # Contents: exporttonews echo x - exporttonews sed 's/^@//' > "exporttonews" <<'@//E*O*F exporttonews//' #! /bin/sh # # NAME # exporttonews - export environment variables to 4Sight's # (the news_server's) environment # # SYNOPSIS # exporttonews environmentvarname ... # # DESCRIPTION # On SGI machines, 4Sight (the news_server) is started up before a # user's .profile or .login configuration file is processed so the # 4Sight has no notion of the user's custom environment. # # exporttonews will take exported environment variables and place them # in the 4Sight's environment. # # EXAMPLE # In your .profile (sh,ksh), you might export your PATH. # # PATH=$PATH:'/additional/path' # export PATH # exporttonews PATH # # In your .login (csh,tcsh), you might export your path. # # set path ($path /additional/path) # exporttonews PATH # NOTE # The variables specified to exporttonews must be exported to the # environment. # # AUTHOR # Dave Ciemiewicz (ciemo@sgi.com), Silicon Graphics, 1988 # for environmentvar in $* do eval value=$"$environmentvar" echo "($environmentvar) ($value) putenv" | psh done @//E*O*F exporttonews// chmod u=rwx,g=rx,o=rx exporttonews exit 0 ----- CUT HERE ----------------------------------------------------------------
jjhnsn@tintin.slcs.slb.com (James Lee Johnson) (06/17/89)
In article <34885@sgi.SGI.COM> kipp@warp.wpd.sgi.com (Kipp Hickman) writes: > >If you start it from 4sight, then it inherits the environment from >4sight. This is the most common problem, because 4sight is started >before your environment is loaded up. A quick-and-dirty solution >is to add the following (sample) line to your user.ps in your >home directory: Is there any way to run 4sight from the .login, rather than have it run automatically and unconditionally? I cannot find any documentation on this "feature" in our 4D manuals, and the SGI hotline was not much help. Thanks in advance, jj -- James Lee Johnson Internet: jjhnsn@slcs.slb.com jjhnsn@cs.utexas.edu UUCP: cs.utexas.edu!slcs.slb.com!jjhnsn cs.utexas.edu!jjhnsn