У меня есть этот текстовый файл;
>> Issue: [B608:hardcoded_sql_expressions] Possible SQL injection vector through string-based query construction.
Severity: Medium Confidence: Low
Location: ./batch/action_reward.py:250
More Info: https://bandit.readthedocs.io/en/latest/plugins/b608_hardcoded_sql_expressions.html
>> Issue: [B303:blacklist] Use of insecure MD2, MD4, MD5, or SHA1 hash function.
Severity: Medium Confidence: High
Location: ./batch/local_runs/get_oapi_stores.py:33
More Info: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b303-md5
>> Issue: [B605:start_process_with_a_shell] Starting a process with a shell, possible injection detected, security issue.
Severity: High Confidence: High
Location: ./batch/local_runs/get_oapi_stores.py:212
More Info: https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html
, и мне нужно конвертировать в однострочные записи, как здесь;
B608 ./batch/action_reward.py:253
B303 ./batch/local_runs/get_oapi_stores.py:33
B605 ./batch/local_runs/get_oapi_stores.py:212
и до сих пор, начали использовать awk с записью и разделители полей
, которые я выполняю с "awk -f sort.awk filename"
BEGIN { RS = ">>" ; FS = "\n" }
{
print $1" "$3
}
, что близко, но не завершено ...
^I$
^I$
Issue: [B608:hardcoded_sql_expressions] Possible SQL injection vector through string-based query construction.^I Location: ./batch/action_reward.py:253$
^I$
Issue: [B303:blacklist] Use of insecure MD2, MD4, MD5, or SHA1 hash function.^I Location: ./batch/local_runs/get_oapi_stores.py:33$
^I$
Issue: [B605:start_process_with_a_shell] Starting a process with a shell, possible injection detected, security issue.^I Location: ./batch/local_runs/get_oapi_stores.py:212$
Как может Я удаляю заголовки / оставшийся текст из строк и удаляю лишние пустые строки, которые он создает?
есть ли способ сделать это с помощью substr или эквивалентного?
ответы с использованием awk, пожалуйста