Sei ku: maitiro ekugadzira yako wega kuraira muLinux

Linux raira mutsara: Wallpaper

Isu tinogara tichitaura nezve mirairo yekumhanya muLinux CLI, consoles, terminal emulators, nezvimwe. Asi panguva ino tinokuunzira imwe dzidziso yakati siyanei, iri mini-gwara rekudzidzisa gadzira yedu yega Linux rairo. Hongu, sekuzvinzwa kwaunoita, nenzira iri nyore uye yakapusa tinokwanisa kugadzira chishandiso chedu uye tichichifonera kubva kuLinux console kuti timhanye uye tinakirwe nacho. Kune izvi isu tine sarudzo dzakasiyana, sezvo tichigona kushandisa akasiyana mapurogiramu mitauro kuigadzira, kunyangwe semuenzaniso wedu isu tichazongotarisa pane Shell kunyorera yeBash.

Maitiro ekugadzira chirongwa kana rairo inoda matanho anotevera:

  1. Nyora kodhi yechishandiso chedu. Kana iwe uchitoziva zvaunoda kana zvaunoda, nyora sosi kodhi yechombo chako chero chiri uye chero mutauro wawasarudza. Semuenzaniso, unogona kuzviita muC, Python, Perl, kana senge script yeBash.
  2. Unganidza kodhi yedu yekodhi kugadzira zvinogoneka. Semuenzaniso, kana iri muC kana C ++, nezvimwe, unogona kuzviita nerubatsiro rweiyo gcc compiler nenzira iri nyore. Kana iri mutauro wakadudzirwa, senge Python, Perl, Ruby, nezvimwe, isu tichafanirwa kuve nemuturikiri wayo akaisirwa uye kuita iyo faira nekodhi yekodhi kuitisa. Iyi zvakare inyaya yechinyorwa cheBash, mune ino kesi muturikiri ndiBash pachayo uye kuti iite kuti ishandiswe isu tinogona kushandisa: chmod + x script_name.sh
  3. Kana tangonyorwa kana isu tine iyo inogoneka faira, tinoteedzera kana kuendesa kune imwe nzira inosanganisirwa mu $ PATH nharaunda inoshanduka, senge / usr / bin. Unogona kuona nzira ne echo $ PATH. Neichi tinogona kuchiita nekungopinza zita raro uye hatizofanirwe kuisa iyo chaiyo nzira.

Kana izvi zvangoitwa isu tine yedu yekuraira yakagadzirira kuita ... unogona kunyora zita rayo uye ichaitwa.

Semuenzaniso, kuti iwe unzwisise, ini ndichaisa muenzaniso unoshanda:

  • Nhanho 1: isu tichaenda kunyorera kodhi, mune ino yakapusa bash script, yeiyi kuvhura yaunofarira mavara edhita uye nyora inotevera kodhi
#!/bin/bash

echo "Hola mundo"

  • Nhanho 2: isu tinochengeta iyo faira faira uye mune yangu kesi ndichaidaidza hello. Uye ikozvino ndinoita kuti zviitwe;
chmod +x hola

  • Nhanho 3: ikozvino yave nguva yekuchinjisa kune inozivikanwa nzira kuti isagare ichifanirwa kuve mune dhairekitori iyo inogarwa kana kuisa iyo chaiyo nzira yekuitwa kwayo ...
cp hola.sh /usr/bin/

Uye ikozvino taigona kuimhanya neyakareruka:

hola

Uye mune ino kesi iwe unofanirwa kuona pachiratidziro meseji iri nyore «Mhoro Nyika«


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Mhinduro, siya zvako

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa.

*

*

  1. Inotarisira data: AB Internet Networks 2008 SL
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako

  1.   Emiliano akadaro

    Iyo faira inofanirwa kunzi hello isina .sh kana iwe uchida kukumbira neyakareruka hello
    Ndinokutendai!