В качестве альтернативы вы можете использовать пасту
и вырезать
:
paste -d'|' <(cut -d'|' -f1 file1) <(cat file2) <(cut -d'|' -f3 file2)
Я не могу сказать, что лучше с точки зрения скорости.
Вы можете использовать расширение фигурной скобки, например.
ag pattern --ignore={'*assets*','*scripts*'} path_to_search
или, как предлагает Гленн здесь, замена процесса:
ag pattern -p <(printf "*%s*\n" assets scripts) path_to_search
Вы можете добавить
*assets*
*scripts*
в свой файл .gitignore
или .ignore
.
Из файла readme:
It ignores file patterns from your .gitignore and .hgignore.
If there are files in your source repo you don't want to search,
just add their patterns to a .ignore file.
формат--игнорировать шаблон от _до _исключить
➜ proj git:(develop) ✗ ag User -l | wc
82 82 2951
➜ proj git:(develop) ✗ ag User -l --ignore 'tests*' | wc
65 65 2348
доказательство
➜ exp tree
.
├── good.py
├── migrations.py
├── test2.py
├── test_another.py
└── tests.py
➜ for i in *.py; do echo "User" > $i; done
➜ exp ag -l --ignore 'test*' --ignore 'migrations*' User
good.py
поэтому был возвращен только один файл good.py , все остальные были отфильтрованы по шаблону