|
@@ -187,7 +187,8 @@ null type pacmatic && { |
|
|
null type apt-get && \ |
|
|
null type apt-get && \ |
|
|
alias aupgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" |
|
|
alias aupgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" |
|
|
null type port && \ |
|
|
null type port && \ |
|
|
alias pupgrade="sudo port -v selfupdate && sudo port -v upgrade outdated && sudo port -v uninstall leaves" |
|
|
|
|
|
|
|
|
alias port="port -v" |
|
|
|
|
|
alias pupgrade="sudo port -v selfupdate && { sudo port -v upgrade outdated; sudo port -v uninstall leaves; }" |
|
|
|
|
|
|
|
|
if iscygwin; then |
|
|
if iscygwin; then |
|
|
null type windate || alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" |
|
|
null type windate || alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" |
|
@@ -214,27 +215,31 @@ netwait(){ |
|
|
cd(){ |
|
|
cd(){ |
|
|
if test $# -eq 0 |
|
|
if test $# -eq 0 |
|
|
then |
|
|
then |
|
|
pushd ~/ |
|
|
|
|
|
|
|
|
pushd ~/ >/dev/null |
|
|
|
|
|
elif ! test -d "$1" |
|
|
|
|
|
then |
|
|
|
|
|
echo `basename ${SHELL}`: cd: "$1": No such file or directory 2>&1 |
|
|
|
|
|
return 1 |
|
|
elif test $1 = - |
|
|
elif test $1 = - |
|
|
then |
|
|
then |
|
|
local pwd="$PWD" |
|
|
local pwd="$PWD" |
|
|
popd >/dev/null |
|
|
popd >/dev/null |
|
|
pushd -n "$pwd" # stack last dir |
|
|
|
|
|
|
|
|
pushd -n "$pwd" >/dev/null # stack last dir |
|
|
else |
|
|
else |
|
|
pushd "$@" |
|
|
|
|
|
|
|
|
pushd "$1" >/dev/null |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# pushd(){ |
|
|
|
|
|
# local pwd="$PWD" |
|
|
|
|
|
# for l in $(\dirs -v -l | \grep "^ [0-9]\+ ${pwd}$" | cut -d " " -f 2 | tac) |
|
|
|
|
|
# do |
|
|
|
|
|
# echo $l |
|
|
|
|
|
# test $l -eq 0 && continue |
|
|
|
|
|
# popd +$l -n |
|
|
|
|
|
# done |
|
|
|
|
|
# command pushd "$@" >/dev/null |
|
|
|
|
|
# } |
|
|
|
|
|
|
|
|
pushd(){ |
|
|
|
|
|
local next="$(realpath "$1")" |
|
|
|
|
|
for l in $(\dirs -v -l | \grep "^ [0-9]\+ *${next}$" | cut -d " " -f 2 | tac) |
|
|
|
|
|
do |
|
|
|
|
|
echo $l |
|
|
|
|
|
test $l -eq 0 && continue |
|
|
|
|
|
popd +$l -n |
|
|
|
|
|
done |
|
|
|
|
|
command pushd "$1" >/dev/null |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
input(){ |
|
|
input(){ |
|
|
local foo |
|
|
local foo |
|
@@ -386,6 +391,7 @@ open_file(){ |
|
|
open "$@" |
|
|
open "$@" |
|
|
elif islinux |
|
|
elif islinux |
|
|
then |
|
|
then |
|
|
|
|
|
touch "$@" |
|
|
if null type pcmanfm; then |
|
|
if null type pcmanfm; then |
|
|
LC_MESSAGES= pcmanfm "$@" |
|
|
LC_MESSAGES= pcmanfm "$@" |
|
|
else |
|
|
else |
|
|