[Roma.pm] Net::SSH non esegue un cd anche con SSH2

Gianni Ceccarelli dakkar at thenautilus.net
Wed Feb 25 06:57:01 PST 2009


On 2009-02-25 "Fabio D'Alfonso" <fabio.dalfonso at fabiodalfonso.com>
wrote:
> se ho capito bene quando la connessione è  con protocollo SSH 2 si può
> eseguire più di un comando.

Questo è vero localmente a Net::SSH::Perl, non in generale (ah, e
"Net::SSH" non è la stessa cosa che "Net::SSH::Perl")

> Io dovrei spostarmi in una diversa dir e lanciare un tar, ma non si
> sposta affatto.

Sono praticamente sicuro che il metodo ->cmd genera una shell separata
sulla macchina remota per ciascuna invocazione. Per cui l'effetto che
ottieni è quello "ovvio".

Suggerimenti:

1) «tar -C $dove_vuoi_andare etc etc»
2) «cd $dove_vuoi_andare;tar -C etc etc»

Non farlo con due comandi separati, non tengono lo stato.

-- 
	Dakkar - <Mobilis in mobile>
	GPG public key fingerprint = A071 E618 DD2C 5901 9574
	                             6FE2 40EA 9883 7519 3F88
	                    key id = 0x75193F88

What kind of love is that?  Not to be loved; never to have shown love.
		-- Commissioner Nancy Hedford, "Metamorphosis",
		   stardate 3219.8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.pm.org/pipermail/roma/attachments/20090225/2e9d4875/attachment.bin>


More information about the Roma mailing list