On Sun, 7 Jun 2015 22:28:01 +0900, Minoru Massaki wrote:

>Hello
>
>There is a input file of variable length records.
>I want to insert the last 8 bytes of a record to front of the record as
>following sample. ...
>
Must it be DFSORT?  For example:

508 $ cat last8; sh last8
#! /bin/sh -x

echo "\
RECORD01X11AAAAAAAA
RECORD02Y2BBBBBBBB
RECORD03ZCCCCCCC
RECORD044A4444444DDDDDDDD
RECORD0555B55555555EEEEEEEE"  |

sed 's/\(.*\)\(........\)/\2 \1/'

AAAAAAAA RECORD01X11
BBBBBBBB RECORD02Y2
ZCCCCCCC RECORD03
DDDDDDDD RECORD044A4444444
EEEEEEEE RECORD0555B55555555
509 $ 

Is it then possible to pipe the output of "sed" into SORTIN?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to