I'm writing a script to setup new debian install's. The problem is in this code:
if [ ! -z "$USER1" ] then sudo -u "$USER1" bash <<-EOF cp "$BASHRC $HOME"/.bashrc wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O "$HOME"/.dircolors echo 'eval $(dircolors -b $HOME/.dircolors)' >> "$HOME"/.bashrc . "$HOME"/.bashrc echo "Here is LS_COLORS in action: " ls -l "$HOME"/ EOF
When I sudo to another user the $HOME variable is not showing/changing this new users home directory.
Can you explain to me the problem?
How would I do this in the best and efficient way?
Why do I keep getting "
cp: cannot stat '': No such file or directory" or "
cp: missing opereand" in my cp command? I think it has something to do with $HOME again..........