1748125 Members
3044 Online
108758 Solutions
New Discussion юеВ

ssh with find command

 
Jolly Kalayil
Occasional Contributor

ssh with find command

Hi

I am running the following command and its failing with error " find: -exec not terminated with ';' "


ssh usrname@ find /shg/HPUX -name *.gz -mtime \+20 -exec ls -l {} \\;

can some one tell me what mistake i am making

jolly
4 REPLIES 4
Rick Garland
Honored Contributor

Re: ssh with find command

Looks like you are escaping the \ symbol at end.

ssh usrname@ find /shg/HPUX -name *.gz -mtime \+20 -exec ls -l {} \\;

I see 2 \ symbols, use 1 symbol

ssh usrname@ find /shg/HPUX -name *.gz -mtime \+20 -exec ls -l {} \;
f. halili
Trusted Contributor

Re: ssh with find command

TRY:


ssh usrname@ `find /shg/HPUX -name *.gz -mtime \+20 -exec ls -l {} \;`

You missed the ``.

I tried this on my machine:

ssh usrname@ `find /tmp -atime +7 -type f -local -exec ls {} \;`

Thanks,
Frederick
derekh
Jolly Kalayil
Occasional Contributor

Re: ssh with find command

Thanks Fedrick

ssh username@ 'find /shg/HPUX -name *.gz -mtime \+20 -exec ls -l {} \;' command works fine

Jolly
f. halili
Trusted Contributor

Re: ssh with find command

Have we worked in the same company before ? 2 Metrotech Brooklyn NY?



derekh