Operating System - HP-UX
1833013 Members
2896 Online
110048 Solutions
New Discussion

/usr/bin/expr: The parameter list is too long.

 
Michael Lampi
Trusted Contributor

/usr/bin/expr: The parameter list is too long.

The above error is output after the following script has run for quite some time:

#!/bin/sh
count2=0003
#dirdepth=/net/nano/usr/y
dirdepth=/b
dircount=0
cd /x
while ((`expr $dircount \< 27` == 1))
do
while ((`expr $count2 \< 9999` == 1))
do
cd z$dircount$count2
count2=`expr $count2 + 1`
done
count2=000
dircount=`expr $dircount + 1`
echo $dircount","$count2
done

while ((`expr $dircount \< 9999` == 1))
do
while ((`expr $count2 \< 9999` == 1))
do
mkdir z$dircount$count2
cd z$dircount$count2
echo "tenspin "$dircount","$count2
count2=`expr $count2 + 1`
done
count2=0
dircount=`expr $dircount + 1`
done




Here is some of the output preceding and including the error when the script dies:

mkdir: cannot create z272240: File exists
tenspin 27,2240
mkdir: cannot create z272241: File exists
tenspin 27,2241
mkdir: cannot create z272242: File exists
tenspin 27,2242
mkdir: cannot create z272243: File exists
tenspin 27,2243
mkdir: cannot create z272244: File exists
tenspin 27,2244
mkdir: cannot create z272245: File exists
tenspin 27,2245
mkdir: cannot create z272246: File exists
tenspin 27,2246
mkdir: cannot create z272247: File exists
tenspin 27,2247
mkdir: cannot create z272248: File exists
tenspin 27,2248
mkdir: cannot create z272249: File exists
tenspin 27,2249
./grueldxx[26]: /usr/bin/expr: The parameter list is too long.
./grueldxx[26]: /usr/bin/expr: The parameter list is too long.
./grueldxx[21]: == 1: Syntax error



Note that I ran this script twice, and got the same error at about the same place. The first time, of course, the mkdir error was not displayed as the directory did not exist previous to the execution of this script.

Any ideas as to why /usr/bin/expr chose this particular time to die?

The system is a C3600, running HP-UX 11.00 with lots of patches. The directory in which these subdirectories are being created are located across the network using NFS v3 on another system.

Thanks!
A journey of 1000 steps ends in a mile.
1 REPLY 1
Tracey
Trusted Contributor

Re: /usr/bin/expr: The parameter list is too long.

Sounds like you have too many directories and/or files out there.