Можно ли изменить количество строк по умолчанию для tail?

Что-то вроде этого может помочь (используя bash ):

# Iterate across the XSD files
for xsdfile in *.xsd
do
    test -f "$xsdfile" || continue

    # Strip the ".xsd" suffix and search for XML files matching this prefix
    prefix="${xsdfile%.xsd}"
    for xmlfile in "$xsdfile"_*.xml
    do
        test -f "$xmlfile" || continue
        xmllint --noout --schema "$xsdfile" "$xmlfile"
    done
done

Если вы хотите проверить все совпадающие файлы XML за одну операцию, это будет работать:

# Iterate across the XSD files
for xsdfile in *.xsd
do
    test -f "$xsdfile" || continue

    # Strip the ".xsd" suffix and search for XML files matching this prefix
    prefix="${xsdfile%.xsd}"
    for xmlfile in "$xsdfile"_*.xml
    do
        # Skip if no files, else do it just once
        test -f "$xmlfile" || continue
        xmllint --noout --schema "$xsdfile" "$xsdfile"_*.xml
        break
    done       
done
2
03.10.2017, 12:40
0 ответов

Теги

Похожие вопросы