I've tried the following ways to assign s value to a variable and print it:
user@ubuntu:~$ bash -c "variable=1111; echo $variable"
user@ubuntu:~$ bash -c "variable=1111; echo $variable > output"
user@ubuntu:~$ cat output
user@ubuntu:~$ bash -c "variable=1111 && echo $variable"
user@ubuntu:~$ bash -c "variable=1111 && echo $variable > output"
user@ubuntu:~$ cat output
user@ubuntu:~$
But as you see, in all the situations I failed to print 1111 in the output. What's wrong?