introducing wcd

This commit is contained in:
Q
2025-03-16 11:53:54 +02:00
parent 6ac21178c5
commit f4ee809fc4

View File

@@ -399,6 +399,15 @@ function scd() {
\cd "$cdto" \cd "$cdto"
} # scd ends } # scd ends
function wcd() {
# cd to folder that matches "which" dirname
if [[ "$1" = "-h" ]] || [[ -z "$1" ]]; then
echo which-cd. Give executable name to cd to the path of the executable
return
fi
\cd $( dirname $( which "$1" ) )
}
## File processing functions ## File processing functions
function foldermenu_prompt { function foldermenu_prompt {