Error - "Too many words from '' "


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Error - "Too many words from '' "
# 1  
Old 09-19-2007
Bug Error - "Too many words from '' "

hi all
i'm really to this forum stuff and to scripting also...
my problem is when i'm using a foreach loop in csh a error is coming "too many words from " .....
this error comes when i run the loop more then 1800 times i think coz when i run it for less then 1800 or so it runs fine....
can anyone help me in that....
thanks in advance
Smilie
# 2  
Old 09-19-2007
Welcome to the forums. It would certainly help if you showed us the script. man csh says
Code:
LIMITATIONS
       Words can be no longer than 1024 characters.

       The system limits argument lists to 10240 characters.

       The  number  of arguments to a command which involves filename expansion
       is limited to 1/6th the number of  characters  allowed  in  an  argument
       list.

       Command substitutions may substitute no more characters than are allowed
       in an argument list.

       To detect looping, the shell restricts the number of alias substitutions
       on a single line to 20.

Also, see this link - 1992: SUMMARY: How many is too many words to csh?
# 3  
Old 09-19-2007
Hammer & Screwdriver Give some info

If you will help us !! We help you Smilie
Can you provide some more info with example and code as well

~~~Sanjay Tripathi~~~
# 4  
Old 09-19-2007
Quote:
Originally Posted by SanjayLinux
If you will help us !! We help you Smilie
Can you provide some more info with example and code as well

~~~Sanjay Tripathi~~~
thanks for your reply !Smilie

foreach k (`cat /home/priyank/try_2/data3/date.txt`)# in this loop i'm opening a file which has 2000 dates in a coloun one by one and this shows hat error...


echo "$k" | awk -F'-' '{print $3"/"$1"/"$2}' >> /home/priyank/try_2/data3/cool.txt
end
# 5  
Old 09-19-2007
Quote:
Originally Posted by vino
Welcome to the forums. It would certainly help if you showed us the script. man csh says
Code:
LIMITATIONS
       Words can be no longer than 1024 characters.

       The system limits argument lists to 10240 characters.

       The  number  of arguments to a command which involves filename expansion
       is limited to 1/6th the number of  characters  allowed  in  an  argument
       list.

       Command substitutions may substitute no more characters than are allowed
       in an argument list.

       To detect looping, the shell restricts the number of alias substitutions
       on a single line to 20.

Also, see this link - 1992: SUMMARY: How many is too many words to csh?



thanks
but i have checked this link but i could not get anything Smilie
# 6  
Old 09-19-2007
thanks vivo
yes i have checked this link but i couldn't get anything please help....
# 7  
Old 09-19-2007
Please read and understand what the man page says.
The man page description says the system limits argument list to 10240 characters. You say you have 2000 entries and assuming each date entry is of the form xx-xx-xx i.e. 8 characters, the argument list computes to atleast 2000 * 8 + 1999 * 1 (whitespace) characters. If my assumptions and calculations are right, then that number is way above 10240.

Anyways, why a for loop when awk alone can do it ? I think this should work as well.

Code:
awk -F'-' '{print $3"/"$1"/"$2}' /home/priyank/try_2/data3/date.txt >> /home/priyank/try_2/data3/cool.txt

I hope this is no homework question.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Shell Programming and Scripting

Find duplicate words in first column between "10" repetiotions

hello I have a file of the form: nameA number number ... nameB number number ... nameA number number ... nameC number number ... nameD number number ... 10 nameA number number ... nameC number number ... nameB number number ... nameC number number ...... (4 Replies)
Discussion started by: phaethon
4 Replies

5. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

6. AIX

"Frames" and "Words" in fcstat output

What are "Frames" and "Words" in the fcstat output? vio1:/home/padmin:# fcstat fcs0 <snip> Transmit Statistics Receive Statistics ------------------- ------------------ Frames: 122844229 363445456 Words: 50940091904 171210861568 <snip> The... (1 Reply)
Discussion started by: kah00na
1 Replies

7. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

8. HP-UX

ERROR: more than one instance of overloaded function "vprintf" has "C" linkage

Hi people! I've got this own library: -------------------------------------------- Personal.h -------------------------------------------- #ifdef __cplusplus extern "C" { #endif #include <stdio.h> #include <stdarg.h> #include <string.h> ... (0 Replies)
Discussion started by: donatoll
0 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question