User Tools

Site Tools


переменные_окружения

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
переменные_окружения [2022/09/07 14:10]
val [Linux]
переменные_окружения [2024/01/31 14:00] (current)
val [Установка переменных окружения]
Line 17: Line 17:
  
 $ ps eaxwww $ ps eaxwww
 +</​code>​ 
 +==== Установка переменных окружения ==== 
 +<​code>​
 $ cat .bashrc $ cat .bashrc
 </​code><​code>​ </​code><​code>​
 ... ...
-export http_proxy=http://​gate.isp.un:​3128/​ +export http_proxy=http://​proxy.isp.un:​3128/​ 
-export https_proxy=http://​gate.isp.un:​3128/​+export https_proxy=http://​proxy.isp.un:​3128/​ 
 +export no_proxy=localhost,​127.0.0.1,​isp.un,​corpX.un
 ... ...
 </​code><​code>​ </​code><​code>​
 +# cat /​etc/​skel/​.pam_environment
 +
 # cat /​etc/​environment # cat /​etc/​environment
 </​code><​code>​ </​code><​code>​
-http_proxy=http://​gate.isp.un:3128 +... 
-https_proxy=http://​gate.isp.un:3128 +#http_proxy=http://​gate.corpX.un:3128 
-no_proxy=localhost,​::1,.debian.org+https_proxy=http://​gate.corpX.un:3128 
 +no_proxy=localhost,​127.0.0.1,isp.un,corpX.un
 </​code>​ </​code>​
- 
- 
 <​code>​ <​code>​
 +$ set -a; source .env; set +a
 +
 $ LANG=""​ date $ LANG=""​ date
  
Line 119: Line 125:
 ==== Чтение значений переменных окружения ===== ==== Чтение значений переменных окружения =====
 <​code>​ <​code>​
-i=sip.conf.sample +request='GET /​index.html ​HTTP/1.1
- +$ echo ${request#GET /
-$ echo $i +$ echo ${request% HTTP*}
-$ echo ${i}  +
-$ echo ${i%.sample} +
- +
-$ i='GET /​index.html'​ +
-$ echo ${i#GET /}+
  
 $ PHONE=''​ $ PHONE=''​
Line 132: Line 133:
 $ PHONE=84951111111 $ PHONE=84951111111
 $ echo ${PHONE:​-84959999999} $ echo ${PHONE:​-84959999999}
 +
 +BRANCH=${1:​-master}
  
 bash$ PHONE=+74951234569 bash$ PHONE=+74951234569
переменные_окружения.1662549002.txt.gz · Last modified: 2022/09/07 14:10 by val