Created
April 21, 2021 21:32
-
-
Save miladvafaeifard/67cd7190bf9ae58be3a4d03045dda032 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# -------------------------------- | |
<< 'user-option-prompting' | |
while getopts "s:e:w:" option; do | |
case "${option}" in | |
w) WS=${OPTARG};; | |
s) SUBSCRIPTION=${OPTARG};; | |
e) EXCLUDE=${OPTARG};; | |
esac | |
done | |
echo $WS | |
user-option-prompting | |
# -------------------------------- | |
<< 'counter-example' | |
COUNTER=0 | |
while [ $COUNTER -lt 10 ]; do | |
echo The counter is $COUNTER | |
let COUNTER=COUNTER+1 | |
done | |
counter-example | |
# -------------------------------- | |
<< 'print-{A..F}-looping' | |
while [[ $# -gt 0 ]]; do | |
echo $1 | |
shift | |
done | |
print-{A..F}-looping | |
# -------------------------------- | |
<< 'print-without-suffix' | |
for pdf in ./SRN/*.yml; do | |
echo ${pdf%.yml} | |
done | |
for i in ./SRN/*.yml; do | |
pre=${i#./SRN/} | |
echo ${pre%.yml}; | |
done | |
print-without-suffix | |
# -------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment