This is a slowly growing collection of hopefully useful and reusable shell functions and patterns. https://code.jan.io/jan/jans_shell_utils
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

13 rindas
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. }