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

185
Vistas
Linux returning every word of a windows path as a different path

I've been having the following issue:

I have a several paths (folders and files), that were done in either MAC or Windows system. Now in our server we want to automatize the access to them, and it should have been pretyt straight forward, but when we try this:

for subfolder in $(find $folder -mindepth 1 -maxdepth 3 -type d -name "A1*"); do
            name=$(basename $subfolder)
            echo $subfolder

What I got is something like this:

/home/datset/Data/A1
protease
from
Bytw
noth
(P456678888)

I've tried every sed, awk, whatever I could get my hand on that I thought it could work, but nothing has worked. I tried \r \n \^M.... Has anyone have an idea?

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

0

I guess your file name contains spaces (/home/datset/Data/A1 protease from Bytw noth (P456678888))?

The shell splits what is returned by your "find" at spaces.

find $folder -mindepth 1 -maxdepth 3 -type d -name "A1*" -print | while read subfolder; do
    name=$(basename "$subfolder")
    echo "$subfolder"

Note the quotes to ensure the integrity of the file names.

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