Kulemba kwa Shell - Maphunziro 09: Kuchokera kumalingaliro kupita kukuchita - Gawo 03

Kulemba kwa Shell - Maphunziro 09: Kuchokera kumalingaliro kupita kukuchita - Gawo 03

Kulemba kwa Shell - Maphunziro 09: Kuchokera kumalingaliro kupita kukuchita - Gawo 03

Mu izi 09 Tutorial za mndandanda wathu wapano pa Kulemba ma Shell, tipitiliza ndi gulu lina la zitsanzo zothandiza mu mawonekedwe a lamulirani, yomwe tinayambira 07 Tutorial.

Ndipo kumbukirani kuti, mu maphunziro am'mbuyomu 07 ndi 08 takhala tikulankhula za gawo lothandiza la Shell Scripting kugwiritsa ntchito malamulo amalamulo kuchotsa magawo ku OS, ndi mu Maphunziro 06 ndi 05, timalankhula zosiyanasiyana Zolemba pa intaneti ndi ena Zabwino. Ngakhale zambiri za maziko amalingaliro ya chinenero cholembera inalembedwa mu Maphunziro 04 mpaka 01.

Kulemba kwa Shell - Maphunziro 08: Kuchokera kumalingaliro kupita kukuchita - Gawo 02

Kulemba kwa Shell - Maphunziro 08: Kuchokera kumalingaliro kupita kukuchita - Gawo 02

Ndipo, musanayambe positi iyi amatchedwa "Kulemba Zipolopolo - Maphunziro 09", tikupangira kuti mufufuzenso zotsatirazi zokhudzana nazo, pamapeto powerenga:

Kulemba kwa Shell - Maphunziro 08: Kuchokera kumalingaliro kupita kukuchita - Gawo 02
Nkhani yowonjezera:
Kulemba kwa Shell - Maphunziro 08: Kuchokera kumalingaliro kupita kukuchita - Gawo 02

Kulemba kwa Shell - Maphunziro 07: Kuchokera kumalingaliro kupita kukuchita - Gawo 01
Nkhani yowonjezera:
Kulemba kwa Shell - Maphunziro 07: Kuchokera kumalingaliro kupita kukuchita - Gawo 01

Maphunziro a Shell Scripting 09

Maphunziro a Shell Scripting 09

Zitsanzo zamalamulo oyambira mu Shell Scripting

Chotsani milingo ndi magawo okhudzana ndi chidziwitso chadongosolo

Kenako, athu Lamula malamulo kuyambira lero, chifukwa phunzirani kulemba zipolopolo Ndizo zotsatirazi:

DISTROV01=$(cat /etc/os-release | grep ID | grep -v "VERSION" | cut -f2 -d\=) ; echo $DISTROV01

DISTROV02=$(cat /etc/os-release | grep ID | grep -v "VERSION_ID" | sed 's/ID=//') ; echo $DISTROV02

DISTROV03=$(lsb_release -d | sed 's/Description://' | awk '{print $1}') ; echo $DISTROV03

DISTROV04=$(lsb_release -i | awk '{print $3}') ; echo $DISTROV04

DISTROV05=$(cat /etc/os-release | grep NAME | grep -v "VERSION" | sed -n '2p' | cut -f2 -d\" | awk '{print $1}') ; echo $DISTROV05

DISTROV06=$(lsb_release -d | sed 's/Description://' | awk '{print $1, $2, $3, $4}') ; echo $DISTROV06

DISTROV07=$(cat /etc/os-release | grep NAME | grep -v "VERSION" | sed -n '2p' | cut -f2 -d\") ; echo $DISTROV07

DISTROV08=$(cat /etc/os-release | grep VERSION= | sed -n '1p' | sed 's/VERSION=//' | sed 's/"//g' | awk '{print $1}') ; echo $DISTROV08

DISTROV09=$(cat /etc/os-release | grep VERSION_ID= | sed -n '1p' | sed 's/VERSION_ID=//' | sed 's/"//g') ; echo $DISTROV09

DISTROV10=$(lsb_release -r | sed 's/Release://') ; echo $DISTROV10

DISTROV11=$(lsb_release -d | awk '{print $4}') ; echo $DISTROV11

DISTROV12=$(lsb_release -c | sed 's/Codename://') ; echo $DISTROV12

DISTROV13=$(cat /etc/os-release | grep VERSION= | sed -n '1p' | sed 's/VERSION=//' | sed 's/"//g' | awk '{print $2}' | sed 's/(//g' | sed 's/)//g') ; echo $DISTROV13

Al yendetsa lamulo lililonse zikuwonetsedwa apa, tipeza a zotsatira zofanana (zotsatira), monga zikuwonekera pachithunzichi:

Chotsani milingo ndi magawo okhudzana ndi chidziwitso chadongosolo

Kumbukirani kuti lingaliro ndi dongosolo lililonse la lamulo ndikuphwanya zomwe lamulo lililonse limachita mkati mwake, kuti muwone momwe Shell Scripting imapangira zomwe zingapezeke. Mwanjira yotere, kumvetsetsa sitepe iliyonse ya dongosolo lolamulidwa. Mwachitsanzo, ndi chitsanzo choyamba, lingaliro lingakhale kuchita zonse motere:

cat /etc/os-release
cat /etc/os-release | grep ID
cat /etc/os-release | grep ID | grep -v "VERSION"
cat /etc/os-release | grep ID | grep -v "VERSION" | cut -f2 -d\=
DISTROV01=$(cat /etc/os-release | grep ID | grep -v "VERSION" | cut -f2 -d\=) ; echo $DISTROV01
Kulemba kwa Shell - Maphunziro 06: Zolemba za Bash Shell - Gawo 3
Nkhani yowonjezera:
Kulemba kwa Shell - Maphunziro 06: Zolemba za Bash Shell - Gawo 3
Kulemba kwa Shell - Maphunziro 05: Zolemba za Bash Shell - Gawo 2
Nkhani yowonjezera:
Kulemba kwa Shell - Maphunziro 05: Zolemba za Bash Shell - Gawo 2

Chikwangwani chachidule cha positi

Mwachidule, tikuyembekeza izi Maphunziro 09 pa "Shell Scripting" pitirizani kupereka chopereka chaching'ono koma chamtengo wapatali malinga ndi cholinga cha kuphunzira ndi kumvetsetsa kuthekera kwa Njira Yolembera Zipolopolo. Ndipo ngati mukufuna kuphunzira zambiri, ndikukupemphani kuti mufufuze zotsatirazi Njira ya YouTube, kumene amalankhula pafupipafupi m'njira yothandiza mphamvu ya chipolopolo scripting ndi a chida chaumisiri ndi maphunziro kuyitana LPI-SOA (Linux positi Ikani - Advanced Optimization Script).

Ngati mumakonda zomwe zili, ndemanga ndikugawana. Ndipo kumbukirani, pitani ku chiyambi chathu «Website», kuwonjezera pa njira yovomerezeka ya uthengawo kuti mumve zambiri, maphunziro ndi zosintha za Linux. Kumadzulo gulu, kuti mumve zambiri pamutu wamasiku ano kapena zina zokhudzana nazo.


Zomwe zili m'nkhaniyi zikutsatira mfundo zathu za malamulo okonzekera. Kuti mufotokoze cholakwika dinani Apa.

Khalani oyamba kuyankha

Siyani ndemanga yanu

Anu email sati lofalitsidwa. Amafuna minda amalembedwa ndi *

*

*

  1. Wotsogolera pazosankhazi: Miguel Ángel Gatón
  2. Cholinga cha deta: Control SPAM, kasamalidwe ka ndemanga.
  3. Kukhazikitsa: Kuvomereza kwanu
  4. Kulumikizana kwa zomwe zafotokozedwazo: Zomwezo siziziwululidwa kwa anthu ena kupatula pakukakamizidwa mwalamulo.
  5. Zosunga: Zosungidwa ndi Occentus Networks (EU)
  6. Ufulu: Nthawi iliyonse mutha kuchepetsa, kuchira ndikuchotsa zidziwitso zanu.