Сравните два выходных файла sql с именами столбцов и распечатайте разницу в другом файле

Вы только что переименовали папку в .... , и так как начинается с . , теперь она скрыта.

тип mv .... имя_папки для его восстановления

Вы также можете ввести ls -la, чтобы перечислить его (поскольку -a печатает скрытые файлы)

Правильный способ убывания файлов и папок двух каталогов — mv fileorfolder .. /.. /

2
19.12.2016, 15:43
2 ответа

с использованием diff

diff file1 file2> changes.log

0
27.01.2020, 22:19

Это решение с использованием Awk:

#!/usr/bin/awk -f

NR == 1 {
    # Get the headers on the first line.
    # Will be done for both files, but we don't mind.
    head[1] = $1;
    head[2] = $2;
}

NR == 3 {
    # For the third line, go though the data in both columns...
    for (i = 1; i <= 2; ++i) {
        # If there's something in col[], then this is the second file.
        if (col[i]) {
            # This is the second file.
            # Test the value of the column against what was in the first file.
            if (col[i] == $i) {
                printf("%s is matching. ", head[i]);
            } else {
                printf("%s is not matching. ", head[i]);
                # Flag that we need to print extra info later.
                check = 1;
            }
        } else {
            # This is the first file.
            # Remember the data in the two columns.
            col[1] = $1;
            col[2] = $2;

            # Reset the record (line) counter.
            NR = 0;

            # Skip to the second file.
            nextfile;
        }
    }

    if (check) {
        printf("Please check.");
    }

    printf("\n");
}

Тестирование:

$ ./script.awk file1 file2
NAME is not matching. OPEN_MODE is matching. Please check.
1
27.01.2020, 22:19

Теги

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