richp wrote:
If I logon to a VMS host that has a Logical defined for a folder, I can CD to that logical and it works.
So why doesn’t the same thing work in UNIX trying to CD to an environment variable?
Here is a VMS terminal session to show the logical of OMR$DAT:
Username: wilprodaxp
Password:
Last interactive login on Friday, 16-FEB-2018 09:08:51.59
WILPRODAXP> show logical omr$dat
"OMR$DAT" = "PROD$1_AXP:[TRADEMGRWILL.DAT]" (LNM$PROCESS_TABLE)
"OMR$DAT" = "DSA100:[TRADEMGRWILL.DAT]" (LNM$GROUP_000205)
WILPRODAXP> show default
PROD$2:[WILPRODAXP]
WILPRODAXP> set default omr$dat
WILPRODAXP> show default
PROD$1_AXP:[TRADEMGRWILL.DAT]
WILPRODAXP>
Here is a command line SFTP session that can CD to OMR$DAT:
N:\WinSCP-5.12.2>WinSCP.com
winscp> open chucky
Searching for host...
Connecting to host...
Authenticating...
Username: wilprodaxp
Password:
Authenticated.
Starting the session...
Session started.
Active session: [1] chucky
winscp> pwd
/DSA100/wilprodaxp
winscp> cd omr$dat
/DSA100/trademgrwill/dat
winscp>
Here is a UNIX terminal session to show the environment variable of $OMR_DAT:
{wbtrad01} su - wilprod
Password:
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
{wilprod} pwd
/wbqa/wilprod
{wilprod} echo $OMR_DAT
/wbqa/dat
{wilprod} cd $OMR_DAT
{wilprod} pwd
/wbqa/dat
{wilprod}
Here is a command line SFTP session that cannot CD to $OMR_DAT:
winscp> open 178.20.10.33
Searching for host...
Connecting to host...
Authenticating...
Username: wilprod
Using keyboard-interactive authentication.
Password:
Authenticated.
Starting the session...
Session started.
Active session: [2] 178.20.10.33
winscp> pwd
/wbqa/traders/wilprod
winscp> cd $OMR_DAT
Error changing directory to '$OMR_DAT'.
Cannot get real path for '/wbqa/traders/wilprod/$OMR_DAT'.
No such file or directory.
Error code: 2
Error message from server: No such file
/wbqa/traders/wilprod
winscp>
VMS... Are you talking Vax VMS?
That's ancient, if so. I learned Vax VMS ages ago, and preferred it to Unix (but Unix won out, now Linux / Wintel, etc...). With it's remote access tools, maybe it gave more access (do they still update a VMS OS?).
Here, you're talking ftp remote access, and what you can do. ftp shells are kept intentionally "dumb", for obvious reasons in today's day & age (you have people who routinely go to a server remotely and try to do bad things).
My recommendation (and as a disclaimer am still pretty new to scripting with winscp, but understand once I'm connected, you probably will only get the basic ftp commands), is to build whatever logic you want outside the ftp / sftp other protocol connection, and use that way.
Anything with winscp specifically, I'll pass to an admin here.