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
Next revision Both sides next revision
переменные_окружения [2022/09/07 13:58]
val [Установленные переменные окружения]
переменные_окружения [2023/03/15 10:14]
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/​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://​proxy.isp.un:​3128 
-no_proxy=localhost,​::1,.debian.org+https_proxy=http://​proxy.isp.un:​3128 
 +no_proxy=localhost,​127.0.0.1,isp.un,corpX.un
 </​code>​ </​code>​
  
-==== Linux ==== 
  
 <​code>​ <​code>​
Line 44: Line 47:
  
 $ wget http://​gate.isp.un/​virus.zip $ wget http://​gate.isp.un/​virus.zip
- 
-$ cat .bashrc 
 </​code>​ </​code>​
  
Line 122: Line 123:
 ==== Чтение значений переменных окружения ===== ==== Чтение значений переменных окружения =====
 <​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 135: Line 131:
 $ PHONE=84951111111 $ PHONE=84951111111
 $ echo ${PHONE:​-84959999999} $ echo ${PHONE:​-84959999999}
 +
 +BRANCH=${1:​-master}
  
 bash$ PHONE=+74951234569 bash$ PHONE=+74951234569
переменные_окружения.txt · Last modified: 2024/01/31 14:00 by val