I was looking for some solution about adding new value into list. Eg. I have list of values

```
n = c(2, 3, 5) 
s = c("aa", "bb", "cc", "dd", "ee") 
b = c(TRUE, FALSE, TRUE, FALSE, FALSE) 
x = list(n, s, b, 3)   # x contains copies of n, s, b

```

and I need to add value 6 to list x to have in x[[1]] 2, 3, 5, 6 values.

How do I do that?
['https://Stackoverflow.com/questions/29349499', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4274408/']
The reason why nothing was being written to the Difference file is because it was not closed. In my create\_diff proc, I forgot to include the command: `close $dso1`
Therefore once the script finished running, only then it would write to the file. However, right after the diff proc, I compress the files, and since it cannot write to a compressed file, the file would be empty.

Tldr; I did not close the file I was writing the differences to.
```
set status [catch {exec diff $file1 $file2} result]

```

"status" is **not** `diff`'s exit status, it is `catch`'s exit status. Not the same. To get `diff`'s exit status:

```
if {$status == 1} {
    set err_type [lindex $::errorCode 0]
    if {$err_type eq "NONE"} {
        # diff exited with exit status 0 but printed something
        # to stderr
    } elseif {$err_type eq "CHILDSTATUS"} {
        # diff returned non-zero status
        set diff_exit_status [lindex $::errorCode end]
        if {$diff_exit_status == 1} {
            # diff results in $result
        } else {
            # diff had some kind of trouble
        }
    }
}

```