Your recommendation is to define alias up=". path/to/up"
so that when you type up 3
, it expands to . up 3
. However, since you want to take an optional argument and affect the state of the current shell, I think you would be better off defining a shell function instead.
As it turns out, the [ -z "1ドル" ]
special case is not necessary, since seq 1
just expands to 1
.
You end up executing n separate cd ..
commands for up n
. This leads to a usability bug: cd -
or cd $OLDPWD
, which normally take you back to the previous directory, don't work the way I expect.
Suggested solution:
up() {
eval cd $(for i in $(seq 1 1ドル) ; do echo -n ../ ; done)
}
Your recommendation is to define alias up=". path/to/up"
so that when you type up 3
, it expands to . up 3
. However, since you want to take an optional argument and affect the state of the current shell, I think you would be better off defining a shell function instead.
As it turns out, the [ -z "1ドル" ]
special case is not necessary, since seq 1
just expands to 1
.
You end up executing n separate cd ..
commands for up n
. This leads to a usability bug: cd -
or cd $OLDPWD
, which normally take you back to the previous directory, don't work the way I expect.
Suggested solution:
up() {
eval cd $(for i in $(seq 1 1ドル) ; do echo -n ../ ; done)
}
Your recommendation is to define alias up=". path/to/up"
so that when you type up 3
, it expands to . up 3
. However, since you want to take an optional argument and affect the state of the current shell, I think you would be better off defining a shell function instead.
As it turns out, the [ -z "1ドル" ]
special case is not necessary, since seq 1
just expands to 1
.
You end up executing n separate cd ..
commands for up n
. This leads to a usability bug: cd -
or cd $OLDPWD
, which normally take you back to the previous directory, don't work the way I expect.
Suggested solution:
up() {
cd $(for i in $(seq 1 1ドル) ; do echo -n ../ ; done)
}
Your recommendation is to define alias up=". path/to/up"
so that when you type up 3
, it expands to . up 3
. However, since you want to take an optional argument and affect the state of the current shell, I think you would be better off defining a shell function instead.
As it turns out, the [ -z "1ドル" ]
special case is not necessary, since seq 1
just expands to 1
.
You end up executing n separate cd ..
commands for up n
. This leads to a usability bug: cd -
or cd $OLDPWD
, which normally take you back to the previous directory, don't work the way I expect.
Suggested solution:
up() {
eval cd $(for i in $(seq 1 1ドル) ; do echo -n ../ ; done)
}