Operating System - HP-UX
1833832 Members
2315 Online
110063 Solutions
New Discussion

Re: ftp and usage of remote environment variable

 
Franky Leeuwerck_1
Regular Advisor

ftp and usage of remote environment variable

Hello there,

I'd like to ftp to a remote server.
The remote server contains, for the user that logs in via the ftp session, an environment variable pointing to a path : $MYPATH .

In the ftp session (ftp script), I try to do :
ftp> cd $MYPATH/rest_of_path

That doesn't work :
550 $COHESION_PATH: No such file or directory.

Does anyone know how to solve this (without the use of perl) ?

Thanks in advance
Franky
7 REPLIES 7
Elena Leontieva
Esteemed Contributor

Re: ftp and usage of remote environment variable

Try lcd $MYPATH/rest_of_path in your script.
Chris Vail
Honored Contributor

Re: ftp and usage of remote environment variable

The .profile of the destination machine is NOT executed when logging in. That means that you cannot generally use environmental variables on the destination machine. You will have to use this information explicitly if you're scripting this ftp process.

This is my particular hobby horse: but ftp does not script easily, and it is hardly secure. You're much better off in the long run to install and use secure shell (which includes secure copy). Secure copy scripts much more readily, and it is of course much more secure.


Chris
Chris Vail
Honored Contributor

Re: ftp and usage of remote environment variable

The .profile of the destination machine is NOT executed when logging in. That means that you cannot generally use environmental variables on the destination machine. You will have to use this information explicitly if you're scripting this ftp process.

This is my particular hobby horse: but ftp does not script easily, and it is hardly secure. You're much better off in the long run to install and use secure shell (which includes secure copy). Secure copy scripts much more readily, and it is of course much more secure.


Chris
Chris Vail
Honored Contributor

Re: ftp and usage of remote environment variable

The .profile of the destination machine is NOT executed when logging in. That means that you cannot generally use environmental variables on the destination machine. You will have to use this information explicitly if you're scripting this ftp process.

This is my particular hobby horse: but ftp does not script easily, and it is hardly secure. You're much better off in the long run to install and use secure shell (which includes secure copy). Secure copy scripts much more readily, and it is of course much more secure.


Chris
Chris Vail
Honored Contributor

Re: ftp and usage of remote environment variable

The .profile of the destination machine is NOT executed when logging in. That means that you cannot generally use environmental variables on the destination machine. You will have to use this information explicitly if you're scripting this ftp process.

This is my particular hobby horse: but ftp does not script easily, and it is hardly secure. You're much better off in the long run to install and use secure shell (which includes secure copy). Secure copy scripts much more readily, and it is of course much more secure.


Chris
Ian Dennison_1
Honored Contributor

Re: ftp and usage of remote environment variable

Franky,

It may not be workable, but,....

Why not run the FTP Script from the other host? (ie the host that has the variable defined on it)

Share and Enjoy! Ian
Building a dumber user
Franky Leeuwerck_1
Regular Advisor

Re: ftp and usage of remote environment variable

Thanks for your response .. even without a solution.

Now I realise I have to work out another solution.

Franky