1 Linux scripting .............................................................................................................................................. 3
1.4 For loop ......................................................................................................................................................... 6
1.4.1 Nummeren in een for loop ................................................................................................................... 7
1.4.2 IFS.......................................................................................................................................................... 7
1.4.3 Verschil $* en $@ ................................................................................................................................. 8
1.6 Exit status ................................................................................................................................................... 10
1.8 Condities if… ............................................................................................................................................... 13
1.8.1 if then fi ............................................................................................................................................... 13
1.8.2 if elif .................................................................................................................................................... 14
1.8.3 && || .................................................................................................................................................. 14
1.9 Case ............................................................................................................................................................ 16
1.10 While do … done ....................................................................................................................................... 17
2. Beheer van users and groups .................................................................................................................... 18
3. Shell-omgeving van gebruikers.................................................................................................................. 22
3.1 User shell .................................................................................................................................................... 22
5.1 Inrichting van de harde schijf...................................................................................................................... 29
5.3 Aanmaken van bestandssystemen ............................................................................................................. 33
5.4 Mounten en unmounten ............................................................................................................................. 33
5.4.1 Mounten van volumes ........................................................................................................................ 33
5.4.2 automatisch mounten........................................................................................................................ 34
5.5 Swap space ................................................................................................................................................ 35
5.6 Onderhoud van bestandssystemen ............................................................................................................. 35
6. Software and Process Management .......................................................................................................... 37
Een shell script is een combinatie van shell opdrachten in een tekstbestand. à Wordt
gebruikt voor de automatisering van taken, systeemadminstratie etc.
In Linux voornamelijk bash shell script, andere talen: powershell (windows), perl, php,
python,...
1.1.1 Variabelen
Maken: Definieer de variabele + ‘=’ + naam variabele
Opvragen: echo $naam
Bv: vandaag=maandag, echo $vandaag
• geen spaties voor en na “=“ !
• geen types, variabelen zijn altijd tekst/strings
• bij voorkeur kleine letters (soms constanten in hoofdletters), hoofdletters worden
ook gebruikt voor omgevingsvariabelen (bv. PATH)
• kan in variabele ook een commando stoppen, bv. prog=xclock
vb script:
3
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller compie. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $6.62. You're not tied to anything after your purchase.