User Tools

Site Tools


informatique:linux:programmation_shell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
informatique:linux:programmation_shell [2020/04/29 09:45] – [Variables spécifiques] $- pteuinformatique:linux:programmation_shell [2020/12/17 15:46] – [Expressions arithmétiques] pteu
Line 433: Line 433:
  
 Pour incrémenter une variable : plusieurs possibilités : Pour incrémenter une variable : plusieurs possibilités :
-  * ''<nowiki>z=`expr $z + 1`</nowiki>'' +  * ''z=`expr $z + 1`'' ou ''z=$(expr $z + 1)'' 
-  * ''<nowiki>z=$(($z+1))</nowiki>'' +  * ''<nowiki>z=$(($z+1))</nowiki>'' ou ''<nowiki>z=$((z+1))</nowiki>'' (entre doubles parenthèses, le $ est optionnel)
-  * ''<nowiki>z=$((z+1))</nowiki>'' (entre doubles parenthèses, le $ est optionnel)+
   * ''<nowiki>(( z += 1 ))</nowiki>''   * ''<nowiki>(( z += 1 ))</nowiki>''
  
Line 839: Line 838:
 </code> </code>
  
-====== Liens ======+====== Ressources ======
  
   * http://abs.traduc.org/abs-5.0-fr/index.html   * http://abs.traduc.org/abs-5.0-fr/index.html
   * http://www.gnu.org/software/bash/manual/bashref.html   * http://www.gnu.org/software/bash/manual/bashref.html
   * [[http://tldp.org/LDP/abs/html/index.html|Advanced Bash-Scripting Guide]]   * [[http://tldp.org/LDP/abs/html/index.html|Advanced Bash-Scripting Guide]]
 +  * https://www.shellcheck.net : super moulinette en ligne pour analyser un script et recommander des améliorations (exsite aussi en package Linux : ''shellcheck''). A utiliser sans modération !
informatique/linux/programmation_shell.txt · Last modified: 2023/10/02 13:35 by pteu