Sponsored Content
Top Forums Shell Programming and Scripting Syntax Error in AIX but working in UX Post 302961934 by fedora132010 on Sunday 6th of December 2015 11:09:18 PM
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 12:26 AM.. Reason: Add CODE tags.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
DATETIME.SUB(3) 							 1							   DATETIME.SUB(3)

DateTime::sub - Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object

       Object oriented style

SYNOPSIS
public DateTime DateTime::sub (DateInterval $interval) DESCRIPTION
Procedural style DateTime date_sub (DateTime $object, DateInterval $interval) Subtracts the specified DateInterval object from the specified DateTime object. PARAMETERS
o $object -Procedural style only: A DateTime object returned by date_create(3). The function modifies this object. o $interval - A DateInterval object RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure. EXAMPLES
Example #1 DateTime.sub(3) example Object oriented style <?php $date = new DateTime('2000-01-20'); $date->sub(new DateInterval('P10D')); echo $date->format('Y-m-d') . " "; ?> Procedural style <?php $date = date_create('2000-01-20'); date_sub($date, date_interval_create_from_date_string('10 days')); echo date_format($date, 'Y-m-d'); ?> The above examples will output: 2000-01-10 Example #2 Further DateTime.sub(3) examples <?php $date = new DateTime('2000-01-20'); $date->sub(new DateInterval('PT10H30S')); echo $date->format('Y-m-d H:i:s') . " "; $date = new DateTime('2000-01-20'); $date->sub(new DateInterval('P7Y5M4DT4H3M2S')); echo $date->format('Y-m-d H:i:s') . " "; ?> The above example will output: 2000-01-19 13:59:30 1992-08-15 19:56:58 Example #3 Beware when subtracting months <?php $date = new DateTime('2001-04-30'); $interval = new DateInterval('P1M'); $date->sub($interval); echo $date->format('Y-m-d') . " "; $date->sub($interval); echo $date->format('Y-m-d') . " "; ?> The above example will output: 2001-03-30 2001-03-02 NOTES
DateTime.modify(3) is an alternative when using PHP 5.2. SEE ALSO
DateTime.add(3), DateTime.diff(3), DateTime.modify(3). PHP Documentation Group DATETIME.SUB(3)
All times are GMT -4. The time now is 02:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy