I have setup the docker container to run the model evaluation.
In bash list all files in cwd that don't contain asdf in the contents (case-ignore)
In bash list all files in cwd that don't contain asdf in the contents (case-ignore)
To list all files in the current working directory (including hidden files) that do not contain the string "asdf" (case-insensitive) in their contents, use the following `find` command:
1 | find . -maxdepth 1 -type f ! -exec grep -qi "asdf" {} \; -printf '%P\n' |
1 | grep -iL "asdf" * |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include <iostream> #include <fstream> #include <string> #include <filesystem> #include <algorithm> using namespace std; using namespace std::filesystem; bool containsASDF(const string& filename) { ifstream file(filename); if (!file.is_open()) return true; string line, target = "asdf"; while (getline(file, line)) { transform(line.begin(), line.end(), line.begin(), ::tolower); if (line.find(target) != string::npos) return true; } return false; } int main() { for (const auto& entry : directory_iterator(".")) { if (entry.is_regular_file() && !containsASDF(entry.path().string())) { cout << entry.path().filename().string() << endl; } } return 0; } |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include <iostream> #include <fstream> #include <string> #include <filesystem> #include <algorithm> using namespace std; using namespace std::filesystem; bool containsASDF(const string& filename) { ifstream file(filename); if (!file.is_open()) return true; string line, target = "asdf"; while (getline(file, line)) { transform(line.begin(), line.end(), line.begin(), ::tolower); if (line.find(target) != string::npos) return true; } return false; } int main() { for (const auto& entry : directory_iterator(".")) { if (entry.is_regular_file() && !containsASDF(entry.path().string())) { cout << entry.path().filename().string() << endl; } } return 0; } |
main.sh: line 8: using: command not found
main.sh: line 9: using: command not found
main.sh: line 11: syntax error near unexpected token `('
main.sh: line 11: `bool containsASDF(const string& filename) {'
Testing if the previous output contains the string lower
: False
Testing if the previous output contains the string asdf
: False
Testing if the previous output contains the string this
: False
Testing if the previous output contains the string there
: False
Testing if the previous output contains the string hello
: False