Search code examples
unixcshtcsh

How to print whole array in tcsh


I want to print the whole array in tcsh, because then i want to pipe it to uniq, is there a way to do it in tcsh.

i had set array

and was printing it:

echo "$array"

but it ended up with error: Word too long, it works for smaller arrrays,

Is there some simple way to do it?


Solution

  • The usual solution to this problem is to work with files instead of variables:

    cat > file <<EOF
    YOUR ARRAY TEXT HERE.....
    EOF
    uniq file