Syntax Error in AIX but working in UX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Syntax Error in AIX but working in UX
# 1  
Old 12-07-2015
Syntax Error in AIX but working in UX

Code:
MENU_INTRO(){
    date="`date`"
    HOSTNAME="`hostname`"
    if [ $# -gt 1 ]; then cols=$2
    else cols=2
    fi
    clear
    now=`date +%A,%B-%d-%Y@%H:%M:%S`
    echo "                            -: INFORMIX DBA MENU :- "
    echo "********************************************************************************"
    echo "$now"
    echo "--------------------------------"
    echo "HOST=`hostname`         LOGNAME=`logname`      PWD=`pwd`"
    echo "********************************************************************************"
    PRT_MENU
        function onstat_p(seq,v,p0,c0,pNR,cNR,pNF,cNF,c0,pf,cf,i,k,n,v0,N,n1){
        while(\"onstat -p\" | getline){p0=c0;pNR=cNR;pNF=cNF;c0=\$0;cNR++;cNF=NF
        if((cNR==(pNR+1))&&(cNR>1)&&(\$1~/^[0-9][0-9]*/)){
              split(p0,pf);split(c0,cf)
              for(i=1;i<=pNF;i++){n=pf[i];v0=cf[i];N[n]++;
                if(N[n]==1){n1=n}else{n1=n N[n]}
                k++;seq[0]=k;seq[k]=n1;v[n1]=v0
              }
            }
          }
          return(seq[0])
        }
        " | pg -csnp "(ONCONFIG & Recommended Parametrs:)Page %d>"
        ;;
      9) #MD#  9#Some more Info
      echo " USE FOLLOWING COMMANDS TO GET MORE INFO ABOUT OS

      modinfo - display information about loaded kernel modules
      rpcinfo - report RPC information
      psrinfo - print processor information
      pkginfo - display software package information
      " | pg -cnsp " Page %d>"
      ;;

----Here's the error-------
Code:
./dprogram.sh[65]: 0403-057 Syntax error at line 80 : `(' is not expected.
[

Line 80 = "  function onstat_p(seq,v,p0,c0,pNR,cNR,pNF,cNF,c0,pf,cf,i,k,n,v0,N,n1){


Last edited by Don Cragun; 12-07-2015 at 01:26 AM.. Reason: Add CODE tags.
# 2  
Old 12-07-2015
What is UX? What shell were you using on UX? And what version of that shell were you using on UX?

What shell are you using on AIX? And what version of that shell are you using on AIX?

The diagnostic you showed us says the error is on line 80 in your script, but you have shown us much less than 80 lines.

If looks like you are defining a function MENU_INTRO() and inside that function definition you are defining another function onstat_p(). Standard shell syntax doesn't allow a function to be defined inside another function.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sum working but getting syntax error - awk

Hi, I am using the following command to get the sum and it is working correctly but I am getting syntax error as well. # ------------------------------------------------------------------------ # Adding awk command support for SunOS -- use nawk for SunOS #... (3 Replies)
Discussion started by: uuuunnnn
3 Replies

2. Shell Programming and Scripting

Shell script check syntax not working ...

Hello i have question that i want check syntax from my script shell with sh -n filename but it's not show something even i have wrong syntax in my file. why can this happened or any other way to check it? i use on header of file : #!/bin/sh thx before :) (7 Replies)
Discussion started by: Gochengz
7 Replies

3. Shell Programming and Scripting

Script working in AIX, but giving error in SOLARIS

Hi, My script is working fine in AIX but throwing an error in SOLARIS system. Here is the error message that I am getting when calculating the elapsed time: /home/x772525/FindETA.sh: start_mins = *60 + : syntax error . ((start_mins = $(expr substr "$j" 1 2)*60 + $(expr substr "$j" 4... (6 Replies)
Discussion started by: ajayakunuri
6 Replies

4. Programming

Pointer for class not working that well. Syntax I think.

I'll be gratefull for any help. Thanks. :) This is the non class type error: # g++ -I/usr/include/mysql -I/usr/include/mysql++ -lmysqlpp -L/usr/lib/mysql -L/usr/local/lib/mysql++ loaddsgsports.cpp -o loaddsgsports loaddsgsports.cpp: In function âint outputToImport(const char*, const char*,... (1 Reply)
Discussion started by: sepoto
1 Replies

5. UNIX for Advanced & Expert Users

rm -rf not working on AIX 6.1

Hi Guys, I have never seen this happen before, but created a directory as a user when installing some software, software install fails so I try and remove the directory as root and get an error. There is no processes using the folder see output: ls -l total 446336 -rwxr----- 1 u0008862... (2 Replies)
Discussion started by: chris5126
2 Replies

6. AIX

decrypt command syntax in AIX

Hi All, Could anyone please share decrypt files command syntax in AIX? Thanks for your time! Regards, (1 Reply)
Discussion started by: a1_win
1 Replies

7. Shell Programming and Scripting

*/5 not working in AIX

Hi Guys, I tried to schedule a script for every 5 mins. i tried */5 but it is not working. Is writing every 5 mins is the only way to do it? like below 05,10,15,20,25,30,35,40,45,50,55 05-08 Thanks And Regards, Magesh (11 Replies)
Discussion started by: mac4rfree
11 Replies

8. Shell Programming and Scripting

for loop not working - syntax error at line 6: `end of file' unexpected

I have a file called test.dat which contains a b I have written a shell script called test.sh for i in `cat test.dat` do echo $i done When i run this script using sh test.sh I get this message - test.sh: syntax error at line 6: `end of file' unexpected What is the... (3 Replies)
Discussion started by: debojyoty
3 Replies

9. AIX

nim mksysb error :/usr/bin/savevg[33]: 1016,07: syntax error

-------------------------------------------------------------------------------- Hello, help me please. I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? : Command : failed stdout: yes stderr: no... (9 Replies)
Discussion started by: astjen
9 Replies

10. AIX

^P Not working on AIX.

I'm working on an AIX box, and I generall prefer emacs command line editing in ksh. Most control-commands are working, except not control-P (Recall previous command). ksh set - o emacs ^p Does not result in the expected outcome. does anyone know why this might be? (0 Replies)
Discussion started by: akbar
0 Replies
Login or Register to Ask a Question

Featured Tech Videos