Trouble recognizing environement variable on remote system for directory change

Advertisement

JimmyMcPhinney
Guest

Trouble recognizing environement variable on remote system for directory change

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:

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Trouble recognizing environement variable on remote system for directory change

What exactly are you doing? How are you "using the variable"?

Reply with quote

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.

Reply with quote

JimmyMcPhinney
Guest

From the remote system:

[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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
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.

Reply with quote

Advertisement

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?

Reply with quote

Advertisement

You can post new topics in this forum