I know I can check if the result is equal to something, like
#!/usr/bin/env bats
@test "Check that total is listed" {
run ls -l
[[ ${lines[0]} =~ "total" ]]
}
but, what if I just want to check if the lines[0] is made of several digits and letters? Should I use a regular expression to do that?
Use a regex, example: