Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

393
Vistas
Absolutize possibly non-existent path in bash? (linux)

There are many instances on SO where people have asked how best to absolutize a path in bash, but I haven't found any that deal with absolutizing non-yet-existent paths.

The cd $1 && pwd method does not work at all for non-existent paths.

The readlink -f $1 method will only work for one level of non-existence; that is, it will work for "~/sdkjf", but not for "~/sdkjf/qweuio"

Ideally, I would like a method that would expand the latter to /home/username/sdkjf/qweuio ... and would also do similar transforms for ./ and ../

Can you recommend a solution?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

readlink -m $1

From the manpage:

  -m, --canonicalize-missing
          canonicalize  by  following  every  symlink  in every component of the given 
          name recursively, without requirements on components existence
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda