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.
1 parent 2f4dfc7 commit 04f6b8fCopy full SHA for 04f6b8f
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