- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scp/rcp and remote env variables
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 08:56 PM
тАО02-05-2009 08:56 PM
scp/rcp and remote env variables
Is it possible for scp/rcp to take the env remote variables
eg:
Local: shivalik
Remote: shivaji
When I am trying to copy a file from a remote server to a local directory using scp, I am getting the following error.
shivalik>#scp shivaji:$HOME/hosts $HOME/hosts1
Password:
scp: /tmp/shivalik/hosts: No such file or directory
shivalik>#rcp shivaji:$HOME/hosts $HOME/hosts1
rcp: /tmp/shivalik/hosts: No such file or directory
shivalik># echo $HOME
/tmp/shivalik
shivalik># ls /tmp/shivalik
passwd
shivaji># echo $HOME
/tmp/shivaji
shivaji># ls /tmp/shivaji
hosts
SO you see here its taking the local variable
Is it possible in anyways to take the remote variable via scp/rcp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 09:08 PM
тАО02-05-2009 09:08 PM
Re: scp/rcp and remote env variables
There **MIGHT** be something that you can do via ssh.config or sshd.config, but I don't know of anything off hand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 09:21 PM
тАО02-05-2009 09:21 PM
Re: scp/rcp and remote env variables
You are right. It won't execute the .profile while we are doing scp/rcp
I like to know if there are any options available or any configuration needs to be done..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 10:55 PM
тАО02-05-2009 10:55 PM
Re: scp/rcp and remote env variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 11:03 PM
тАО02-05-2009 11:03 PM
Re: scp/rcp and remote env variables
Thanks for your reply.
It not only with only one variable $HOME.
My query is how is it possible to do scp/rcp by defining remote env. variable as provided in the above question
Local variables works fine, its only that the remote variable are not taken into consideration !!
Is it possible, and if yes, then how.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 11:17 PM
тАО02-05-2009 11:17 PM
Re: scp/rcp and remote env variables
#scp shivaji:$REMOTE_HOME/hosts $HOME/hosts1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 11:20 PM
тАО02-05-2009 11:20 PM
Re: scp/rcp and remote env variables
thanks for your reply,
As told earlier, this works fine when local variable are defined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2009 11:57 PM
тАО02-05-2009 11:57 PM
Re: scp/rcp and remote env variables
the remote end, then you would need to keep
the local shell from evaluating it. For
example:
scp shivaji:'$HOME/hosts' $HOME/hosts1
But that won't help if the program at the
other end does not try to evaluate the
variable. I don't know what will happen
with scp.
You might do better with a "tar" pipeline and
SSH, where the command for the remote end
includes the (quoted) variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2009 12:42 AM
тАО02-06-2009 12:42 AM
Re: scp/rcp and remote env variables
shivalik> scp shivaji:'$HOME/hosts' .
rcp: //hosts: No such file or directory
### Let me check with one of my customer who claims its possible & is working fine at his site on one of his HP-UX server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2009 07:05 AM
тАО02-06-2009 07:05 AM
Re: scp/rcp and remote env variables
> rcp: //hosts: No such file or directory
If you're using "scp", why does the complaint
say "rcp"?
"//hosts" makes it look as if "$HOME" was
"/", which is not what I'd expect if HOME
were undefined.
This might make more sense if you did less
editing of the transcript showing what you
did, and what happened when you did it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2009 07:53 AM
тАО02-06-2009 07:53 AM
Re: scp/rcp and remote env variables
Apologies for the same !!
#uname -a
HP-UX shivalik B.11.23 U ia64 3360995785 unlimited-user license
#echo $HOME
/tmp/shivalik
#cat /.profile| grep HOME
export HOME=/tmp/shivalik
#ls /tmp/shivalik
.sw passwd
#scp shivaji:'$HOME/hosts' $HOME/hosts1
Password:
scp: //hosts: No such file or directory
#rcp shivaji:'$HOME/hosts' $HOME/hosts1
rcp: //hosts: No such file or directory
# uname -a
HP-UX shivaji B.11.11 U 9000/811 2007026426 unlimited-user license
# echo $HOME
/tmp/shivaji
# cat /.profile | grep HOME
export HOME=/tmp/shivaji
# ls /tmp/shivaji
.sw hosts
## This could also simulate the same issue on the server
## Take two server, and ty to do the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2009 10:18 AM
тАО02-06-2009 10:18 AM
Re: scp/rcp and remote env variables
Not sure how is it possible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 09:07 AM
тАО02-09-2009 09:07 AM
Re: scp/rcp and remote env variables
Thanks everyone