When installing Rust toolchain in Docker, Bash `source` command doesn’t work

You have to add the sourcing inside the .bashrc. This works: FROM ubuntu:16.04 # Update default packages RUN apt-get update # Get Ubuntu packages RUN apt-get install -y \ build-essential \ curl # Update new packages RUN apt-get update # Get Rust RUN curl https://sh.rustup.rs -sSf | bash -s — -y RUN echo ‘source $HOME/.cargo/env’ … Read more

Why does the equal to operator not work if it is not surrounded by spaces?

test (or [ expr ]) is a builtin function. Like all functions in bash, you pass its arguments as whitespace separated words. As the man page for bash builtins states: “Each operator and operand must be a separate argument.” It’s just the way bash and most other Unix shells work. Variable assignment is different. In … Read more

How can I escape a single quote in a single-quote string in Bash?

echo ‘I\’m a student’ does not work. But the following works: echo $’I\’m a student’ From the man page of bash: A single quote may not occur between single quotes, even when preceded by a backslash. …. Words of the form $’string’ are treated specially. The word expands to string, with backslash-escaped characters replaced as … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)