encontra erro de sintaxe

1

Estou recebendo um erro durante a execução, assim:

find /var/www/virtual/gm.com/episodes/htdocs/downloaded/ -type f -iname '*flash*' -exec ln -sf {} /var/www/virtual/gm.com/234/htdocs/

find: argumento faltando para '-exec'. Tente "encontrar --help" para mais informações.

O que há de errado?

    
por Joel G Mathew 19.07.2017 / 14:42

1 resposta

8

Você está perdendo o ponto-e-vírgula final, que precisa ser escapado do shell, como: \; ou ';' .

A página man find diz o seguinte:

-exec command ;

Execute command; true if 0 status is returned. All following arguments to find are taken to be arguments to the command

...

Atenção aqui:

until an argument consisting of ';' is encountered.

...

The string '{}' is replaced by the current file name being processed everywhere it occurs in the arguments to the command, not just in arguments where it is alone, as in some versions of find. Both of these constructions might need to be escaped (with a '\') or quoted to protect them from expansion by the shell.

...

    
por 19.07.2017 / 14:48

Tags