bash
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| bash [2011/10/05 16:03] – ginko | bash [2014/05/27 11:02] (current) – [Cheat Sheet] ginko | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| * [[http:// | * [[http:// | ||
| ====== Cheat Sheet ====== | ====== Cheat Sheet ====== | ||
| + | * [[bash_cheatsheet|Bash parameters & history cheatsheet]] | ||
| ===== Shebang ===== | ===== Shebang ===== | ||
| <code bash># | <code bash># | ||
| Line 69: | Line 70: | ||
| ====== 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 81: | Line 89: | ||
| ===== 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 100: | Line 126: | ||
| * <code bash># | * <code bash># | ||
| # To list partitions: fdisk -l (with root privilegies) | # To list partitions: fdisk -l (with root privilegies) | ||
| - | dd if=/ | + | dd if=/ |
| + | ===== Useful ===== | ||
| + | * Convertir les html entities dans les noms de fichier (ex. : '' | ||
| + | |||
bash.1317823399.txt.gz · Last modified: 2011/10/05 16:03 by ginko
