Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Sorry, but SCP protocol is obsolete, so we have no intention to make any SCP-only features.
JimmyMcPhinney

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

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

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

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

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

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

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.