1836770 Members
2267 Online
110109 Solutions
New Discussion

Re: csh error

 
SOLVED
Go to solution
vladimir gershman
Occasional Advisor

csh error

Hello,

I try assign a bunch of items to a csh variable:
set a = "$a1 $a2 $a3"

where a1, a2 and a3 have lists of strings in them.

I get an error message "Word too long".

Anybody knows how to fix that?

Thanks,

Vlad
4 REPLIES 4
harry d brown jr
Honored Contributor

Re: csh error

The length of the COMBINATION of a1 + a2 + a3 exceeds the longest line possibility.

You need to trim one of them down, or better yet: use perl.

live free or die
harry
Live Free or Die
vladimir gershman
Occasional Advisor

Re: csh error

thanks
harry d brown jr
Honored Contributor
Solution

Re: csh error

This was a quick test I did:

# set a1=`ls -lR /tmp;ls -l /tmp;ls -l /tmp;ls -l /tmp`
# set a="$a1 $a2 $a3"
Word too long.
# echo $a1|wc
1 3191 17880
# echo $a2|wc
1 1 1012
# echo $a3|wc
1 1 721
#

and I had a2 and a3 equal to some silly long strings.

live free or die
harry
Live Free or Die
Ron Kinner
Honored Contributor

Re: csh error

The limit for a variable in csh is 1024 characters. Not much you can do about it I'm afraid other than to use something besides csh.

Ron