Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

after ssh how can i use existing script variable

hi guys,

i am doing ssh for working in remote machine, some of the private and global variables are declared in existing sctipt but those are not in remote server, how can i export all command.
After ssh i have to entered so many lines of command , do i have to use script or is there any other way??
is there any command i can find all private & global vaible used in script.
0
parlepoint
Asked:
parlepoint
  • 3
  • 2
1 Solution
 
ravenplCommented:
> is there any command i can find all private & global vaible used in script.
bash will print them using
printenv # will show globals (env)
set # will print all, global and locals

Do You want ssh client to copy local variables to remote server? You can do that (but only env variables, the exported ones)

ssh -2 -o "SendEnv VAR_NAME" user@remote.tld
of course server have to be configured to accept env variables, which is NOT(!) default.
0
 
parlepointAuthor Commented:
hi..this is very useful information.
is there any command so we can see all private variable used by shell script.
0
 
ravenplCommented:
Only private, I dont know.
Otherwise: set
0
 
parlepointAuthor Commented:
set don't give you private ??right??
0
 
ravenplCommented:
It gives. But it gives globals as well(globals == env variables)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now