This is a slowly growing collection of hopefully useful and reusable shell functions and patterns. https://code.jan.io/jan/jans_shell_utils
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

13 строки
383B

  1. # Copyright (c) 2022 Jan Lehnardt <jan@apache.org>, MIT licensed
  2. # via https://github.com/apache/couchdb/blob/1b8d4b73bc9ea67bfe0df5a41e24ea864f4c846d/rel/files/couchdb.in#L15 Apache 2 Licensed
  3. canonical_readlink () {
  4. file=$(dirname "$1")/$(basename "$1");
  5. if [ -h "file" ]; then
  6. cd $(dirname "$1")
  7. canonical_readlink $(readlink "file");
  8. else
  9. cd "${1%/*}" && pwd -P;
  10. fi
  11. }