Outils pour utilisateurs

Outils du site


tech:script_bash_fonctions_envrac

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:script_bash_fonctions_envrac [2026/06/30 21:52] – Jean-Baptistetech:script_bash_fonctions_envrac [2026/09/23 09:41] (Version actuelle) – Jean-Baptiste
Ligne 44: Ligne 44:
  
  
-exit_si_erreur(){+exit_si_erreur() {
     if [ $1 != 0 ]     if [ $1 != 0 ]
     then     then
Ligne 364: Ligne 364:
 ~~~bash ~~~bash
 cat <<EOF | bash -s -- cat <<EOF | bash -s --
-same_uid_for_Utilisateur_and_utilisateur() +same_uid_for_Utilisateur_and_utilisateur() {
-{+
     local -i RET=0     local -i RET=0
     local -i UID_Utilisateur=$(id -u Utilisateur)     local -i UID_Utilisateur=$(id -u Utilisateur)
Ligne 398: Ligne 397:
  
 ~~~bash ~~~bash
-waitpid() +waitpid() {
-{+
         while ps -p $1 >/dev/null ;          while ps -p $1 >/dev/null ; 
         do         do
Ligne 490: Ligne 488:
  
  
-Note : [[https://fr.wikipedia.org/wiki/NOP|NOP]] en bash :+Note : [NOP](https://fr.wikipedia.org/wiki/NOP) en bash :
 ~~~bash ~~~bash
 true true
Ligne 559: Ligne 557:
 ~~~ ~~~
  
------------ 
  
-~~~bash +Negate error code. Reverse false true posix command exit code
-#!/bin/bash +
-SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"+
  
-${SCRIPT_PATH}/sds_run.sh portal +Voir aussi : 
-~~~ +* /usr/lib/nagios/plugins/negate
- +
------+
  
 ~~~bash ~~~bash
Ligne 598: Ligne 591:
 ~~~ ~~~
  
-Voir aussi : +Negate pipe exit code 
-* PIPESTATUS + 
-* pipefail+Voir : 
 +* https://www.baeldung.com/linux/exit-status-piped-processes 
 + 
 +~~~ 
 +$ ls -l /tmp/toto | tee out.txt ; test ${PIPESTATUS[0]} -ne 0 
 +ls: cannot access '/tmp/toto': No such file or directory 
 +$ echo $? 
 +0 
 + 
 +$ ls -l /etc >/dev/null | tee out.txt ; test ${PIPESTATUS[0]} -ne 0 
 +$ echo $? 
 +1 
 +~~~ 
 + 
 + 
 +## Autres 
 + 
 +~~~bash 
 +#!/bin/bash 
 +SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 
 + 
 +${SCRIPT_PATH}/sds_run.sh portal 
 +~~~
  
  
tech/script_bash_fonctions_envrac.1782849125.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki