bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash segfaults processing a certain .bashrc file on AMD 64-bit machi


From: Paul Jarc
Subject: Re: bash segfaults processing a certain .bashrc file on AMD 64-bit machine
Date: Wed, 17 Nov 2004 10:33:25 -0500
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

Chris Rodgers <rodgers@physchem.ox.ac.uk> wrote:
> I got the cleanpath function off the web,

That was mine.  I don't know if it will help, but you could try this
version:

function cleanpath {
  local var="${1:-PATH}" oldpath newpath=: entry
  oldpath="${!var}:"
  while [ -n "$oldpath" ]; do
    entry="${oldpath%%:*}"
    oldpath="${oldpath#*:}"
    case "$entry" in /*)
      case "$newpath" in
        *:"$entry":*) ;;
        *) [ -d "$entry" ] && newpath="$newpath$entry:";;
      esac;;
    esac
  done
  newpath="${newpath#:}"
  eval "$var"'="${newpath%:}"'
}

> export
> PATH=/home/stieltjes/rodgers/bin:/home/stieltjes/.rodgers-pub/bin:/home/stieltjes/.rodgers-pub/bin/wineexecbin/bin:$P\ATH;

Is that backslash really there?  It will probably not do what you
want, although it shouldn't cause a segfault.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]