We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f6ecb9e + 3c26829 commit ba50a91Copy full SHA for ba50a91
x
@@ -15,7 +15,8 @@ realpath() {
15
if [ -L "$path" ]; then
16
readlink -f "$path"
17
elif [ -d "$path" ]; then
18
- (cd -P "$path" && pwd)
+ # "cd" is not always silent (e.g. when CDPATH is set), so discard its output.
19
+ (cd -P "$path" >/dev/null && pwd)
20
else
21
echo "$(realpath "$(dirname "$path")")/$(basename "$path")"
22
fi
0 commit comments