Skip to content

Commit

Permalink
Answer for Q15 (#845)
Browse files Browse the repository at this point in the history
Adds scripts and correct answer for Q15.
  • Loading branch information
Adrián Buenfil authored Dec 7, 2020
1 parent b0b5c74 commit e238704
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bash/bash-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,17 @@ mysql < file.sql > file.txt
- [ ] `var=$(( 10 / 8 ))`
- [x] `var=$(echo 'scale=2; 10 / 8' | bc)`
#### Q15. What is the result of this script? - TODO add script
#### Q15. What is the result of this script?
```bash
txt=Penguins
[[ $txt =~ [a-z]{8} ]]; echo $?
```
- [ ] 0, representing 'true', because the variable "txt" contains eight letters
- [ ] 0, representing 'true', because everybody loves penguins!
- [ ] 1, representing 'false', because the variable "txt" is longer than eight characters
- [ ] 1, representing 'false', because the variable "txt" does not contain eight lowercase letters between a and z
- [x] 1, representing 'false', because the variable "txt" does not contain eight lowercase letters between a and z
#### Q16. How would you change your Bash shell prompt to the following?
Expand Down

0 comments on commit e238704

Please sign in to comment.