System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to qualify domain/user within a script

SOLVED
Go to solution
Patricia_30
Occasional Visitor

How to qualify domain/user within a script

I currently run an automated script that transfers files to our ftp server which is on our domain.

I now have to send to a group ftp server which is on a different domain. If I manually connect I can qualify the domain\user no problem but when I put this into a script the "\" disappears which makes the user name invalid.

I have tried the following formats:
remote_user="domain\user"
remote_user=`domain\user`
remote_user='domain\user'

result = domainuser - which fails the login process.
5 REPLIES
Michael Mike Reaser
Valued Contributor

Re: How to qualify domain/user within a script

The "\" slash is an escape character to most shells, and thus will be "eaten" in most variable assignments. If you want that character to appear in your string, perhaps try

remote_user="domain\\user"

with TWO slashes.
There's no place like 127.0.0.1

HP-Server-Literate since 1979
Patrick Wallek
Honored Contributor
Solution

Re: How to qualify domain/user within a script

I use the @ sign.

remote_user="user@domain"

Patricia_30
Occasional Visitor

Re: How to qualify domain/user within a script

Have tried with two "\\" still ignored and fails login
Patricia_30
Occasional Visitor

Re: How to qualify domain/user within a script

tried with the @ sign - works perfectly, thankyou
Patricia_30
Occasional Visitor

Re: How to qualify domain/user within a script

Another user has provided the solution