Oups!

Le Tue, Feb 17, 2026 at 09:14:00AM +0100, Félix Hauri via Bug reports for the 
GNU Bourne Again SHell a écrit :
> So my purpose, (with lot of bashisms):
> ...
>                 eval builtin cd ${_cd_upDir// /..\/}
> ...

eval is not required here!

cd() { 
    [[ ${1::1} == - ]] &&
      case ${1:1} in 
        '' | *[^0-9]*) ;;
        *)
            local _cd_upDir
            printf -v _cd_upDir '%*s' ${1:1}
            builtin cd ${_cd_upDir// /..\/}
            return $?
        ;;
    esac
    builtin cd "$@"
}

Sorry!

-- 
 Félix Hauri  -  <[email protected]>  -  http://www.f-hauri.ch


Reply via email to