3 ms·
Hey guys, I have the same thing, but I called the command ".." (no it doesn't conflict with the directory). ".." by itself is the same as ".. 3" .. () {
by imglorp 7y ago
Hey guys, I have the same thing, but I called the command ".." (no it doesn't conflict with the directory). ".." by itself is the same as ".. 3"
.. () {
local arg=${1:-1};
while [ $arg -gt 0 ]; do
builtin cd .. &> /dev/null;
arg=$(($arg - 1));
done;
}
- msoucy 7y agoMine is similar, but only does one cd command - to allow better use of `cd -` up() { local ups="." for((i=0;i<${1:-1};i++)); do ups="${ups}/.." done builtin cd "$ups" }