Topic "Trouble recognizing environement variable on remote system for directory change"

Author Message
JimmyMcPhinney

Guest


So the documented means to move to the Check Point program directory on their products running GAiA (a modified Red Hat distro) is to utilize the $FWDIR environment variable they have defined. An error results when trying to change to the remote directory as the variable is defined via WinSCP:

Code:

Command 'cd "\$FWDIR"'
failed with return code 1 and error message
-bash: line 97: cd: $FWDIR: No such file or directory.


So it seems to not be translating it as a variable. Yes, I can simply just use the path that is the string stored as the variable, but I'm curious if it is possible to use the environment variable. Thanks.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
What exactly are you doing? How are you "using the variable"?
JimmyMcPhinney

Guest


When using Open directory/bookmark (Ctrl-O) to open the Location Profiles window and in the Remote directory field.

That is where I put in a path that is an environment variable on the remote system, $FWDIR. And it returns with the error message in my original post.
JimmyMcPhinney

Guest


From the remote system:

Code:

[Expert@HQ-FW1:0]# echo $FWDIR
/opt/CPsuite-R77/fw1
[Expert@HQ-FW1:0]# pwd
/home/admin
[Expert@HQ-FW1:0]# cd $FWDIR
[Expert@HQ-FW1:0]# pwd
/opt/CPsuite-R77/fw1
[Expert@HQ-FW1:0]#


Environment variables like $FWDIR are what WinSCP should recognize as a client of the remote system. WinSCP does require bash to log on, after all, so there's no reason it shouldn't interpret environment variables, no? It would certainly be "common sense" functionality to have.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
You can use local environment variables in some places:
https://winscp.net/eng/docs/local_path

But not remote variables.

WinSCP does not require the bash to login. Well, it does, for the SCP protocol, but that's a minor use.

For other protocols, like SFTP, FTP or WebDAV, WinSCP has no interaction with a shell or any way to resolve remote variables.
JimmyMcPhinney

Guest


Well boo. That sucks and, yes, you are correct that SCP is exactly what I am using it for, so I thought it would be able to recognize the remote environment variable since it interfaces with bash.

Maybe we can put it down as a feature request?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Sorry, but SCP protocol is obsolete, so we have no intention to make any SCP-only features.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License