help-ksh as cronjob, line too long


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help-ksh as cronjob, line too long
# 8  
Old 12-13-2011
That "sed -n l" output is so weird. There does not seem to be any line terminators (they should show as dollar signs).
If you try a similar command on say your shell script file you will see what I mean (unless you have a funny "sed"). The line terminators must be in the file or we wouldn't be able to read the file with "sed".

If you have a manual for the product, perhaps that will explain the formatting issue. Or can you contact the authors of the product?

Last edited by methyl; 12-13-2011 at 08:52 AM..
# 9  
Old 12-13-2011
Paste the output of cat -A <filename>. Lets see...

--ahamed
# 10  
Old 12-13-2011
Or if you haven't got "cat -A":
Code:
cat -ve $LOGFILE5

# 11  
Old 12-13-2011
cat -A isn't available. It's a solaris 10 U8 ...:

Code:
root@blnace302> cat -ve /tmp/mylog5
Date              Id     Device            Component         Type              $
----------------- ------ ----------------- ----------------- ----------------- $
2011-07-15        404869 blnace302-ST6140_ Tray.85.PowerSupp Problem           $
10:20:27                 2-1247769116      ly.A                                $
                         (StorageTek 6140)                                     $
2011-07-15        404872 blnace302-ST6140_ Tray.85.PowerSupp ProblemClearEvent $
10:25:27                 2-1247769116      ly.A                                $
                         (StorageTek 6140)                                     $
2011-10-25        463900 blnace302-ST6140_ Tray.85.PowerSupp Problem           $
12:24:13                 1-1247766974      ly.B                                $
                         (StorageTek 6140)                                     $
2011-10-25        463913 blnace302-ST6140_ Tray.85.PowerSupp ProblemClearEvent $
12:54:13                 1-1247766974      ly.B                                $
                         (StorageTek 6140)                                     $
root@blnace302>

# 12  
Old 12-13-2011
Seems to be fixed length 80-character records.
Those who write awk programs should be able to re-assemble the error line.
It's not impossible in Shell script.

Still pursue getting the program to output in a machine-readable format.
This User Gave Thanks to methyl For This Post:
# 13  
Old 12-13-2011
I came up with this... see if it helps...
Code:
...
$LSSCS list -t Problem -f PowerSupply event >>$LOGFILE1 2>&1
...
awk '/^Date|^-/{next}
function myprint()
{       
        for(i=1;i<=j;i++) x=x" "a[i]
        for(i=1;i<=j;i++) x=x" "b[i]
        for(i=1;i<=j;i++) x=x c[i]; x=x" "
        for(i=1;i<=j;i++) x=x d[i]; x=x" "
        for(i=1;i<=j;i++) x=x e[i]
        print x; j=0;x=""
}       
/^[0-9][0-9][0-9][0-9]/&&j>0{myprint()}
{
        a[++j]=substr($0,1,17);gsub(" *$","",a[j])
        b[j]=substr($0,19,7);gsub(" *$","",b[j])
        c[j]=substr($0,26,18);gsub(" *$","",c[j])
        d[j]=substr($0,44,18);gsub(" *$","",d[j])
        e[j]=substr($0,62,18);gsub(" *$","",e[j])
}
END{myprint()} ' $LOGFILE1

--ahamed
This User Gave Thanks to ahamed101 For This Post:
# 14  
Old 12-14-2011
Hello ahamed,

thx so far, but since i'm not so familiar with awk syntax i can just send the errormessage, 'set -x' does not offer more than ...:
Code:
...
END{myprint()}  /opt/scripts/NA04913772/a1.log
awk: syntax error near line 2
awk: bailing out near line 2

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh script throwing arg list too long for mv cp wc - everything

i have a ksh script which internally calls another ksh script. this inner script has simple commands like shown in the code window. In the script im trying to do a mv - it fails with arg list too long. then i try to perform cp and cat - and both are failing with similar error. :wall: How is... (4 Replies)
Discussion started by: nyc68
4 Replies

2. Solaris

Line too long error Replace string with new line line character

I get a file which has all its content in a single row. The file contains xml data containing 3000 records, but all in a single row, making it difficult for Unix to Process the file. I decided to insert a new line character at all occurrences of a particular string in this file (say replacing... (4 Replies)
Discussion started by: ducati
4 Replies

3. AIX

aix:ksh: /usr/bin/rm: 0403-027 The parameter list is too long.

Hi, I am getting the below error message When i am trying to delete the files from the directory.Could you please guide me? rm *.aud ksh: /usr/bin/rm: 0403-027 The parameter list is too long. and find /oracle/admin/testP/adump/*.aud -mtime +5 -exec rm {} \; ksh: /usr/bin/find:... (3 Replies)
Discussion started by: nokiae63
3 Replies

4. UNIX for Dummies Questions & Answers

vi : Line too Long Error

Hi ! I am woking on Solaris 5.10 and face a problem sometimes when i try to open files in the vi editor . Sometime when the file is big i am not able to view the file in vi and i get the error like I guess vi have some line size setting and if the lines are ,longer than that... (4 Replies)
Discussion started by: Paarth
4 Replies

5. UNIX for Dummies Questions & Answers

grep long line

I am trying to get the count of a word from an xml using the below command grep "search word" -c test.xml The result is only 1, because my xml contains only one line (hule line- several thousand characters). I guess grep command will process for only 128 characters for each line. ... (7 Replies)
Discussion started by: venky23
7 Replies

6. UNIX for Advanced & Expert Users

help on ksh and sql..getting error as is too long. maximum size is 240 characters."

Hi, In my script i am executing sql file and there are some variables in SQL files which are assigned at run time. one of the variable value is having more than 240 characters and at time of execution its getting failed with error as "is too long. maximum size is 240 characters." ... (1 Reply)
Discussion started by: pooga17
1 Replies

7. UNIX for Dummies Questions & Answers

vi.....line too long

I'm getting a "line too long" error when I try to vi a particular file. I really just need to view the contents as I don't have to change anything. Any suggestions?? I already tried to cat but it didnt work........:( (7 Replies)
Discussion started by: shorty
7 Replies

8. Shell Programming and Scripting

search a long line

Hey all, I need to retrieve something from a line, say <TEST><A>123</A><B>456</B><ID>1111</ID><C>789</C><D>000</D></TEST><TEST><A>123</A><B>456</B><ID>2222</ID><C>789</C><D>000</D></TEST> I need to match <ID>111</ID>, so I want to retrieve <ID>1111</ID><C>789</C><D>000</D></TEST> is... (14 Replies)
Discussion started by: mpang_
14 Replies

9. UNIX for Dummies Questions & Answers

ksh: /usr/bin/ls: arg list too long

I am using IBM AIX unix version 4.3.3.0. In a directory there are many files with different patterns. When I am trying to execute the command, ls -l with the file pattern, which have fewer files it gives the desired result. However when I am trying to execute the same command for file pattern,... (2 Replies)
Discussion started by: jitindrabappa
2 Replies

10. Shell Programming and Scripting

ksh: /bin/grep: arg list too long

when i run the command below in a directory which contains too many files i got the error: ksh: /bin/grep: arg list too long ls|grep AA*B* how can i handle this problem? (5 Replies)
Discussion started by: gfhgfnhhn
5 Replies
Login or Register to Ask a Question