Subject: Re: export/unset PKG_PATH: perhaps this will help someone
To: paul <pkdb1@attbi.com>
From: David S. <davids@idiom.com>
List: netbsd-users
Date: 02/27/2002 14:32:33
> I found I kept needing to switch back and forth between installing
> from pkgsrc and using pkg_add, which requires unsetting and
> setting PKG_PATH. So I am trying this as a function in my .bashrc:
> it will set my PKG_PATH variable, pass the command line argument t
> the real pkg_add command, and then unset PKG_PATH again.
>
> function pkgadd {
> export
> PKG_PATH=ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/All
> /usr/sbin/pkg_add $*
> unset PKG_PATH
> }
>
I'm not sure why you need to set and unset $PKG_ADD, but
PKG_PATH=ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/All /usr/sbin/pkg_add $*
will set the $PKG_PATH to the given value only in the environment of the
"/usr/sbin/pkg_add *" process and its children, not in any other process
launched from the same shell.
David S.