bash, script seqdate
2018-10-17 | #commande #date #seq
Script réutilisable pour générer des dates avec date et seq #!/bin/bash usage() { local msg="$1" if [[ -n "$msg" ]]; then echo $msg fi echo "usage: $0 <FROM=YYYY-MM-DD> <TO=YYYY-MM-DD>" >&2 exit 1 } if [[ "$#" -ne 2 ]]; then usage fi FORMAT="%Y-%m-%d" FROM=$(date --d "$1" +"$FORMAT") TO=$(date --d "$2" +"$FORMAT") if [[ "$FROM" > "$TO" ]]; then read FROM TO <<< "$TO $FROM" fi echo $FROM while [[ "$FROM" !