0

Im trying to create a dynamic path to directorie /lib, but the code bellow is giving me a error, that the directorie does not exist.

user=$USER
home=$HOME

rsync -az /$home/$user/lib /media/x/x

Could somebody give me a tipp on how to solve the problem?

Bruno Alves
  • 51
  • 1
  • 1
  • 7

1 Answers1

0

Echo out the value of your string that is represented by "/$home/$user/lib" and check if it is what you intended.

Have you tried this:

rsync -az $HOME/lib /media/x/x

The $HOME variable represents "/Users/username". By adding the preceding slash you get "//Users/username" and then by adding the username afterwards you get "//Users/username/username". I think that's your problem.

Rupert
  • 1,629
  • 11
  • 23