Created
September 26, 2016 14:38
-
-
Save Skardian/231b3f8f3b9159cfd031ba22aeb55a19 to your computer and use it in GitHub Desktop.
Ejercicio BASH Generación DevOps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # while [[ $1 ]]; do # Opción Fabiano | |
| # while (( $1 )); do # Opción Jesús | |
| while [ "$#" -gt 1 ]; do | |
| # echo $1 | |
| case $1 in | |
| -d) | |
| DIR=$2 | |
| shift | |
| ;; | |
| -f) | |
| FILE=$2 | |
| shift | |
| ;; | |
| *) | |
| ;; | |
| esac | |
| shift | |
| done | |
| DIR=${DIR:-.} | |
| FILE=${FILE:-salida.txt} | |
| # echo $DIR | |
| # echo $FILE | |
| ls -1 ${DIR} > ${FILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment