2006-02-12 21:14:21 +08:00
|
|
|
|
|
|
|
if test (uname) = Darwin
|
2006-03-02 00:53:47 +08:00
|
|
|
function prompt_pwd -d (N_ "Print the current working directory, shortend to fit the prompt")
|
2006-02-12 21:14:21 +08:00
|
|
|
if test "$PWD" != "$HOME"
|
|
|
|
printf "%s" (echo $PWD|sed -e 's|/private||' -e "s|^$HOME|~|" -e 's-/\([^/]\)\([^/]*\)-/\1-g')
|
|
|
|
echo $PWD|sed -e 's-.*/[^/]\([^/]*$\)-\1-'
|
|
|
|
else
|
|
|
|
echo '~'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
2006-03-02 00:53:47 +08:00
|
|
|
function prompt_pwd -d (N_ "Print the current working directory, shortend to fit the prompt")
|
2006-02-12 21:14:21 +08:00
|
|
|
if test "$PWD" != "$HOME"
|
|
|
|
printf "%s" (echo $PWD|sed -e "s|^$HOME|~|" -e 's-/\([^/]\)\([^/]*\)-/\1-g')
|
2006-07-11 06:38:48 +08:00
|
|
|
echo $PWD|sed -n -e 's-.*/[^/]\([^/]*$\)-\1-p'
|
2006-02-12 21:14:21 +08:00
|
|
|
else
|
|
|
|
echo '~'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|