H
H
hckn2019-01-06 16:54:53
bash
hckn, 2019-01-06 16:54:53

Why doesn't path work from a variable?

dir="/home/$USER/temp"
wget -P $dir http://download.redis.io/releases/redis-$release.tar.gz
tar xzf $dir/redis-$release.tar.gz

tarswears on the way. Moreover, if I use it without a variable, it works.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2019-01-06
@saboteur_kiev

Where do you set the $release variable?
$USER is a system variable, it is set by the bash itself when starting the bash process as a user. What is $release?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question