2 added 85 characters in body
source | link

Use a NUL-delimited stream to read output from find that works in all cases -- including names that end in newlines. Also, you can use printf '%q' to generate a readable representation of a filename.

inum=888696
if IFS= read -r -d '' filename < <(find . -inum 888696"$inum" -print0); then
  LC_ALL=C printf 'Read'Located filename: %q\n' "$filename" >&2
  cd -- "$filename"
else
  echo "No file located for inode $inum" >&2
fi

Use a NUL-delimited stream to read output from find that works in all cases -- including names that end in newlines. Also, you can use printf '%q' to generate a readable representation of a filename.

if IFS= read -r -d '' filename < <(find . -inum 888696 -print0); then
  LC_ALL=C printf 'Read filename: %q\n' "$filename"
  cd -- "$filename"
fi

Use a NUL-delimited stream to read output from find that works in all cases -- including names that end in newlines. Also, you can use printf '%q' to generate a readable representation of a filename.

inum=888696
if IFS= read -r -d '' filename < <(find . -inum "$inum" -print0); then
  LC_ALL=C printf 'Located filename: %q\n' "$filename" >&2
  cd -- "$filename"
else
  echo "No file located for inode $inum" >&2
fi
1
source | link

Use a NUL-delimited stream to read output from find that works in all cases -- including names that end in newlines. Also, you can use printf '%q' to generate a readable representation of a filename.

if IFS= read -r -d '' filename < <(find . -inum 888696 -print0); then
  LC_ALL=C printf 'Read filename: %q\n' "$filename"
  cd -- "$filename"
fi