Operating System - HP-UX
1748184 Members
3679 Online
108759 Solutions
New Discussion юеВ

The parameter list is too long.

 
Richard Mertz
Regular Advisor

The parameter list is too long.

I have a shell script that is getting parameter list too long errors. However, the following is a trace of the commands. None of the commands have too many parameters.

+ mv 010308.alert_coe.log /home/oracle/rdbms/log/oldies/010308.alert_coe.log
/opt/ora/oper/bin/.entrails/dbSummarizeAlertLog[53]: /usr/bin/mv: The parameter list is too long.

+ cat /tmp/dbSummarizeAlertLog.tmp
/opt/ora/oper/bin/.entrails/dbSummarizeAlertLog[54]: /usr/bin/cat: The parameter list is too long.

+ uname -n
/opt/ora/oper/bin/.entrails/dbSummarizeAlertLog[54]: /usr/bin/uname: The parameter list is too long.

+ mailx -s Final Alert Log for coe on 010308 oracle@
/opt/ora/oper/bin/.entrails/dbSummarizeAlertLog[54]: /usr/bin/mailx: The parameter list is too long.

Richard
What anybody thinks of me is none of my business.
7 REPLIES 7
Victor BERRIDGE
Honored Contributor

Re: The parameter list is too long.

Hi,
Use xargs (look at man xargs)

Good luck

Victor
David MILLARD
Occasional Advisor

Re: The parameter list is too long.

We had something similar to this (although i think the message was "too many parameters") when an HP engineer was trying to test a new tape drive. He used a tar command on /etc but got the tape drive and the /etc/* the wrong way round on the command line. The effect of this was to create the tar archive in the first file in /etc - which happens to be MANPATH. Every time someone logged in after this it put this file into their environment which meant that no-one could run any commands.

Typing the command 'set' at the unix prompt showed up this problem !
Victor BERRIDGE
Honored Contributor

Re: The parameter list is too long.

Richard Mertz
Regular Advisor

Re: The parameter list is too long.

Victor--why are you suggesting using xargs?
What anybody thinks of me is none of my business.
Richard Mertz
Regular Advisor

Re: The parameter list is too long.

Victor

I tried xargs and got the same thing:

+ echo /home/oracle/rdbms/log/oldies/010315.alert_coe.log
+ xargs mv 010315.alert_coe.log
/opt/ora/oper/bin/.entrails/dbSummarizeAlertLog[53]: /usr/bin/xargs: The parameter list is too long.
What anybody thinks of me is none of my business.
Rodney Hills
Honored Contributor

Re: The parameter list is too long.

I think we need to see the original source lines of the commands, rather than the shell expanded trace.

If you have "*" unquoted in any command, it will be expanded with the list of all the files in the current directory.
There be dragons...
Richard Mertz
Regular Advisor

Re: The parameter list is too long.

Source using xargs:

echo $MESSAGE>/tmp/dbSummarizeAlertLog.tmp
echo Logfile: $LOG
echo SaveAlert: $SAVEALERT
set -x
echo $SAVEALERT/$LOG|xargs mv $LOG
echo /tmp/dbSummarizeAlertLog.tmp|xargs cat|mailx -s "Final Alert Log for $DBNAME on $SUMMARIZEDATE" oracle@`uname -n`


source w/o xargs

mv $LOG $SAVEALERT/$LOG
cat /tmp/dbSummarizeAlertLog|mailx -s "Final Alert Log for $DBNAME on $SUMMARIZEDATE" oracle@`uname -n`
What anybody thinks of me is none of my business.