SlideServe
Menu
Préférences
© SlideServe · v2026

Essential Shell Scripting Guide for Beginners

lhagans avatar
16 diapositives · 214 Views · Jan 04, 2020

Learn shell scripting with special variables, managing parameters, if-else conditions, loop syntax, and decision-making techniques in Linux shell scripts. Discover how to utilize if-else statements effectively.

Essential Shell Scripting Guide for Beginners - slide 1
01 / 16Essential Shell Scripting Guide for Beginners
1 / 17

Télécharger la présentation

Essential Shell Scripting Guide for Beginners
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Lab 8 Shell Script Reference: Linux Shell Scripting Tutorial v1.05r3A Beginner's handbook http://www.freeos.com/guides/lsst/index.html

  2. Special shell variables $0…$9 Positional parameters or command line arguments myscript $0 foo $1 Bar$2 $#tells you how many parameter your script was given

  3. if condition if condition which is used for decision making in shell script, If given condition is true then command1 is executed. Syntax: if condition then command1... fi

  4. if condition

  5. test command or [ expr ] - -True  return zero(0) Is used to see if an expression is true - -Falsereturns nonzero Syntax:test expression OR [ expression ] Run it as follows:

  6. test command or [ expr ]

  7. test command or [ expr ]

  8. test command or [ expr ]

  9. if …else…fi If given condition is true then command1 is executed otherwise command2 is executed. Syntax: if condition then condition else if condition is not true then execute all commands up to fi fi

  10. if …else…fi

  11. if …else…fi Syntax: if condition Then if condition then ..... .. do this else .... .. do this fi else ... ..... do this fi

  12. Nested if-else-fi

  13. Multilevel if-then-else Syntax: if condition then condition is zero (true - 0) execute all commands up to elif statement elif condition1 then condition1 is zero (true - 0) execute all commands up to elif statement elif condition2 then condition2 is zero (true - 0) execute all commands up to elif statement else None of the above condtion,condtion1,condtion2 are true (i.e. all of the above nonzero or false) execute all commands up to fi fi

  14. for Loop Syntax: for { variable name } in { list } Do execute one for each item in the list until the list is not finished (And repeat all statement between do and done) done

  15. for Loop