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 29f3942 + 04f6b8f commit dc3c62aCopy full SHA for dc3c62a
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