LINUX.ORG.RU

Не отрабатывает пайп

 , ,


0

1

У меня лапки и я никак не пойму, почему не работает такой пайп.

find ~/Documents -type f -name 'отчетность 2018.xlsx' | xargs -0 -r xdg-open

Допустим если файл отчетности лежит в ~/Documents/папка1/папка2/отчеты/отчетность 2018.xlsx, то пайп выводит такую ошибку

gio: file:///home/kraken/Documents/%BB%D0%BE....xlsx: Error when getting information for file /home/krakern/Documents/папка1/папка2/отчеты/отчетность 2018.xlsx

Там где многоточие много таких знаков вида %..%. Если без -0 запускать, то пайп ломается на пробелах. Подскажите, как починить. Пробовал добавлять ‘{}’ в конце xargs, но на пробелы ето не повлиято ((

$ man find

       -print0
              True;  print the full file name on the standard output, fol‐
              lowed by a null character (instead of the newline  character
              that -print uses).  This allows file names that contain new‐
              lines or other types of white space to be  correctly  inter‐
              preted  by  programs  that  process  the  find output.  This
              option corresponds to the -0 option of xargs.

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.