using sed to remove lines

Can somebody explain why my sed command is not working.

I do the folloinwg:

Generates a binary file to /tmp/x1.out

/usr/lib/sa/sa2 -s 4:00 -e 8:00 -i 3600 -A -o /tmp/x1.out

decodes the file (no problem so far)

sar -f /tmp/x1.out 

When I do this it does not appear to delete the lines from the top of
the file. Why is that.

sar -f /tmp/x1.out  | sed '2d'

I know this sar command is writing to stdout since when I do this I see the contents of the output in the new file.

sar -f /tmp/x1.out  1> /tmp/j1.out

Thanks in advance to all who answer this post

Not sure what sar is, but this example uses cat to display a text file.

# cat test
1
2
3
4
5
6

# cat test | sed '2d'
1
3
4
5
6

# cat test | sed '1,2d'
3
4
5
6

I know that works, you can man sar to see what it does and I know it
writes to stdout as per my test.

This is what the output shoudl look like its just plain text, I have no clue
why this is an issue. I even wrote a 3 line program that does a printf to stdout and piped it to sed and that worked. What's the mystery?

AIX diamond 3 5 000C86CF4C00 08/05/10

System configuration: lcpu=4

04:00:00 %usr %sys %wio %idle
04:20:00 6 6 4 83
04:40:00 0 1 0 99
05:00:00 0 1 0 99
05:20:00 0 1 0 99
05:40:00 0 0 0 99
06:00:00 1 3 0 96
06:20:00 1 5 0 94
06:40:00 0 1 0 99
07:00:00 0 1 0 99
07:20:01 4 2 3 91
07:40:01 4 3 3 90
08:00:00 4 5 2 90

Average 2 2 1 95

Worked on my HP-UX box, but I dont have a file for it to read.

#   sar -R -d 1 5

HP-UX MyServerName B.11.31 U ia64    08/05/10

08:13:46   device   %busy   avque     r/s     w/s  blks/s  avwait  avserv
08:13:47    disk3    1.00    0.50       0       1      16    0.00    8.66
08:13:48    disk3   13.00    0.50      30       0     480    0.00    4.34
08:13:49  c3t15d0    0.99    0.50       0       2      32    0.00    0.90
            disk3   56.44   67.69       1     143    2295  234.33   28.81
08:13:50    disk3   39.00    3.63       0      76    1118  119.57   38.54
           disk10    1.00    0.50       0       2      18    0.00    0.84
08:13:51

Average     disk3   21.96   41.63       6      44     785  170.89   28.75
Average   c3t15d0    0.20    0.50       0       0       6    0.00    0.90
Average    disk10    0.20    0.50       0       0       4    0.00    0.84

#   sar -R -d 1 5 | sed '2d'


08:14:09   device   %busy   avque     r/s     w/s  blks/s  avwait  avserv
08:14:10    disk3    3.92    0.50       8       1     204    0.00    4.50
08:14:11
08:14:12    disk3    1.00    0.50       0       2      36    0.00    7.92
08:14:13
08:14:14

Average     disk3    1.00    0.50       2       1      49    0.00    5.12

Samething works for me too when I just run the sar command.

I am guessing some how when reading the file they maybe changing
the file descriptor to another number other than stdout or stderr. Could that confuse sed?

I guess I will post this in an IBM specific forum to verify.

If anybody with an AIX box can try my above-mentioned example I would
apprciate it, this will verify if its the sar command. BTW, I am running aix
version 5.3