Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions concepts/quoting/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ ls *.md
```

Filename expansion is a feature of the _shell_, not of the `ls` program.
Before it runs `ls`, bash replaces the pattern with the names of the matching files.
If the directory contains `a.md` and `b.md`, then `ls` is run as `ls a.md b.md`: `ls` never sees the `*`.
Every command gets the same treatment, which is why `echo *.md` prints the file names too.

Expand Down
11 changes: 11 additions & 0 deletions exercises/concept/messy-downloads/messy_downloads.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ test_looking_at_file_with_brackets() { # @test
assert_line --index 0 'Looking at "notes [v2].txt"'
}

# bats test_tags=task:1
test_looking_at_file_with_repeated_spaces() { # @test
# Created in $BATS_TEST_TMPDIR (see setup), so bats cleans it up.
printf 'old news\n' > 'my old report.txt'

run bash "$script" 'my old report.txt' 'txt' 'note'

assert_success
assert_line --index 0 'Looking at "my old report.txt"'
}

# bats test_tags=task:2
test_contents_of_file_with_spaces() { # @test
run bash "$script" 'my report.txt' 'txt' 'note'
Expand Down
Loading