From mboxrd@z Thu Jan 1 00:00:00 1970 From: Piter PUNK Date: Tue, 07 Nov 2006 13:19:23 +0000 Subject: Re: rule_generator.functions: invalid PATH? Message-Id: <455087DB.10702@terra.com.br> List-Id: References: <454EA668.7030203@kadzban.is-a-geek.net> In-Reply-To: <454EA668.7030203@kadzban.is-a-geek.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Marco d'Itri wrote: > On Nov 07, Piter PUNK wrote: > >> sysreadlink() { > -> local file="$1" > -> local LINK="" > + local OLD_DIRECTORY=$(pwd) >> local i >> [ -e "/sys$DEVPATH/$file" ] || return 0 >> cd /sys$DEVPATH/$file >> pwd -P > + cd "$OLD_DIRECTORY" >> } > > The original $PWD must be restored. Oooops! Of course! Needs to remove the local i, too: sysreadlink() { local file="$1" local OLD_DIRECTORY=$(pwd) [ -e "/sys$DEVPATH/$file" ] || return 0 cd /sys$DEVPATH/$file pwd -P cd "$OLD_DIRECTORY" } This is OK to all now? Thanks again for the help Piter PUNK -- | E-Mail: piterpk@terra.com.br (personal) .|. roberto.batista@ntux.com.br (professional) /V\ // \\ UIN:116043354 Homepage:http://piterpunk.info02.com.br /( )\ ^`~'^ ----> Slackware Linux - The Best One! <---- #105432 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel