how i can export private & public variables and alias in ssh login

hi guys..

i want to do ssh and i want use same private & public( variable and alias) in remote machine.
how can i declare those variable in alias?
parlepointAsked:
Who is Participating?
 
parlepointConnect With a Mentor Author Commented:
i did not understand how to give this command

  (set; alias) >myvarsandaliases

0
 
nitinsawhneyCommented:
Best option would be to copy the contents of your .profile/.bash_profile to the same file on remote mahine.

Creating alias is simple just open your *profile* file and add

alias myAlias="some shell command"

e.g. alias LS = "ls -latr"

Hope this information is of some help.

Cheers!
0
 
nitinsawhneyCommented:
Forgot to mention.
profile file may be named differently depending upon the shell you use.

If you are using bash then don't forget to do execute source .bash_profile after adding any new entry to the profile file.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ahoffmannCommented:
> how i can export private & public variables and alias in ssh login
depends on your shell,
# sh and friends
  (set; alias) >myvarsandaliases

# csh and friends
  (set; printenv; alias) >myvarsandaliases
0
 
parlepointAuthor Commented:
i have korn shell will it be work ??
where i have to give this command???
0
 
ahoffmannCommented:
> i have korn shell ..
  (set; alias) >myvarsandaliases

> where i have to give this command???
  on the command line, obviously ...
0
 
parlepointAuthor Commented:
do i have to make changes in .cshrc file...or what..
0
 
ahoffmannCommented:
> do i have to make changes in .cshrc file...or what..
no

BTW, why would you change .cshrc when you use ksh?
Did you ever read any manual about your shell?
0
 
parlepointAuthor Commented:

do i have to use this command to set alias...like this

set alias my='cd /home/mytest/myresult'



0
 
ahoffmannCommented:
no (at least not in ash, bash, csh, esh, ksh, lsh, pdksh, rsh, sh, tcsh, tsh, zsh, ...)
0
 
parlepointAuthor Commented:
then what command i have to use...
0
 
ahoffmannCommented:
command for what?

http:#20005501
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.