[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

ssh and many command line



hello, 

I try to execute many command on a remote system through ssh but some of those commands fails. What is THE way to execute many commands through ssh ?


exemples
-----------

 [1] ssh root@myhost "cat /etc/passwd | awk -F ':' '{ print $1; }'"

     ONLY prints empty lines



 [2]     ssh root@$ip "(  \
           uname -a; \
	   echo '<hr>'; \
           fdisk -l; \
	   echo '<hr>'; \
           ps auwxf; \
	   echo '<hr>'; \
           find /users -type f \
	   echo '<hr>'; \
	   cat /etc/passwd; \
	   for name in `cat /etc/passwd | awk -F : '{ print $1}'`; do echo '<b>'$name'<b><ul>';crontab -u name -l; echo '</ul>'; done; \
	   echo '<hr>'; \
         )"


the for name in ... command is executed by the local machine and not the remote one ???



	Any help is welcome :-)

		François


-- 
Debian SID
Linux tanna 2.6.0-test2 #10 Tue Aug 5 13:36:17 CEST 2003 i686 GNU/Linux
Linux Counter #59413
PGP fingerprint : 9AFA 15EC 96C9 F607 EBC1  DD41 70C5 F0E0 25A5 105B

Attachment: pgpgizTwkJBMG.pgp
Description: PGP signature


Reply to: