bash
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
bash [2010/10/12 10:16] – ginko | bash [2014/04/25 20:44] – [Useful] ginko | ||
---|---|---|---|
Line 1: | Line 1: | ||
Bash est un langage de shell de linux. | Bash est un langage de shell de linux. | ||
Il est installé par défaut sur Ubuntu. | Il est installé par défaut sur Ubuntu. | ||
+ | ====== UI ====== | ||
+ | * [[http:// | ||
====== Cheat Sheet ====== | ====== Cheat Sheet ====== | ||
===== Shebang ===== | ===== Shebang ===== | ||
Line 67: | Line 69: | ||
====== Astuces ====== | ====== Astuces ====== | ||
+ | |||
+ | ===== Everyday shell life ===== | ||
+ | Pour se simplifier la vie : | ||
+ | * les [[shell: | ||
+ | * les [[shell: | ||
+ | * l' | ||
+ | * l' | ||
===== notify-send ===== | ===== notify-send ===== | ||
La commande notify-send est intallée dans le paquet libnotify dans les dépôts debian. | La commande notify-send est intallée dans le paquet libnotify dans les dépôts debian. | ||
Line 79: | Line 88: | ||
===== Options & getopts ===== | ===== Options & getopts ===== | ||
+ | Un petit script d' | ||
+ | <code bash>#! / | ||
+ | # -*- coding: utf-8 -*- | ||
+ | |||
+ | echo $@ | ||
+ | while getopts " | ||
+ | # a colon at the beginning means "no warning message" | ||
+ | case $opt in | ||
+ | a) a=1;; | ||
+ | b) b=$OPTARG;; # OPTARG is set to the corresponding operand | ||
+ | c) c=1;; | ||
+ | *) echo plop;; | ||
+ | esac | ||
+ | done | ||
+ | shift $(($OPTIND-1)) # OPTIND is set to the first argument not processed by getopts => command shifts to the first non optionnal arg | ||
+ | echo "a: $a; b: $b; c: $c" | ||
+ | echo $@ | ||
+ | </ | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
Line 95: | Line 122: | ||
* [[ip_forwarding]] | * [[ip_forwarding]] | ||
* [[rhythmbox-load]] | * [[rhythmbox-load]] | ||
+ | ===== Commandes Unix ===== | ||
+ | * <code bash># | ||
+ | # To list partitions: fdisk -l (with root privilegies) | ||
+ | dd if=/ | ||
+ | ===== Useful ===== | ||
+ | * Convertir les html entities dans les noms de fichier (ex. : '' | ||
+ | |||
bash.txt · Last modified: 2014/05/27 11:02 by ginko