processes | environment variables
The shell is an interpreter that executes commands on the user's behalf
The terminal is not the same as the shell
-----------------
Check which shell is running:
ubuntu@ubuntu:~$ echo $0
bash
-----------------
pipe | allows using the output from some commands as an input to other
-----------------
ubuntu@ubuntu:~$ vim &
[1] 4515
ubuntu@ubuntu:~$ ps
PID TTY TIME CMD
3255 pts/0 00:00:00 bash
4515 pts/0 00:00:00 vim
4522 pts/0 00:00:00 ps
[1]+ Stopped vim
ubuntu@ubuntu:~$ jobs
[1]+ Stopped vim
ubuntu@ubuntu:~$ fg %1
vim #runs VIM
ubuntu@ubuntu:~$
The terminal is not the same as the shell
-----------------
Check which shell is running:
ubuntu@ubuntu:~$ echo $0
bash
-----------------
pipe | allows using the output from some commands as an input to other
-----------------
ubuntu@ubuntu:~$ vim &
[1] 4515
ubuntu@ubuntu:~$ ps
PID TTY TIME CMD
3255 pts/0 00:00:00 bash
4515 pts/0 00:00:00 vim
4522 pts/0 00:00:00 ps
[1]+ Stopped vim
ubuntu@ubuntu:~$ jobs
[1]+ Stopped vim
ubuntu@ubuntu:~$ fg %1
vim #runs VIM
ubuntu@ubuntu:~$
-----------------
ubuntu@ubuntu:~$ pwd_text=$(pwd;date)
ubuntu@ubuntu:~$ echo "pwd_text"
pwd_text
ubuntu@ubuntu:~$ echo "$pwd_text"
/home/ubuntu
Sun Mar 15 02:58:32 PDT 2015
ubuntu@ubuntu:~$
-----------------
to make variable - environment variable
ubuntu@ubuntu:~$ export pwd_text=$(pwd;date)
to remove a variable
ubuntu@ubuntu:~$ unset pwd_text
-----------------
environment variables are available for all processes on the system
printenv displays all environment variables
ubuntu@ubuntu:~$ printenv | grep -i shell
SHELL=/bin/bash
-----------------
Comments
Post a Comment