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

Re: OT: shell prompt tip



i know - i'm replying to my own post ... :)

<pedant>

unquoted lines are changed

> cd() {
   local p="$1"
>   while :; do
     local np="${p//.../../..}"
>     test "$p" == "$np" && break
>     p="$np"
>   done
>   builtin cd "$p"
> }

</pedant>

greetings

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Real programmers don't comment their code.
It was hard to write, it should be hard to understand.
--
Become part of the world's biggest computer cluster - 
join http://www.distributed.net/



Reply to: