how to read the password from variable?
Posted
by
Viswa
on Ask Ubuntu
See other posts from Ask Ubuntu
or by Viswa
Published on 2012-07-05T10:55:12Z
Indexed on
2012/07/06
15:23 UTC
Read the original article
Hit count: 231
I am trying to move my file to another system which is located in some other place, with this command:
rsync -avrz src destination
It works fine. But what I need is to put this command in shell script and run it like:
#! /bin/sh
rsync -avrz srcfilelocation destination
When it runs, it asks for the destination system password. I know that password and give it manually.
Now I have decided to assign the password to an environment variable, like pswd="destination system password"
. I need my shell script to read the password from this variable. How can I write a script to do this?
© Ask Ubuntu or respective owner