Join Every 5 Lines With $ Symbol

Hi All,

I have output like this in one file.

IFName: aust00m1.mis.amat.com[ 0 [ 257 ] ]
ObjID: 5eceea48-0d59-71dd-1512-9887a1f10000
IFAlias: Dest: AMNA austkchr1-ser0/0/0:0.315 Type: FRASI CID: DHEC.559128
IFDescription: ATM9/1/0.315-atm subif
Status: Normal
IFName: aust00m1.mis.amat.com[ 0 [ 258 ] ]
ObjID: 5ed18d98-0d59-71dd-1512-9887a1f10000
IFAlias: Dest: AMNA austkchr1-ser0/0/0:0.315 Type: FRASI CID: DHEC.559128
IFDescription: ATM9/1/0.315-aal5 layer
Status: Normal
IFName: aust00m1.mis.amat.com[ 0 [ 259 ] ]
ObjID: 5ed53358-0d59-71dd-1512-9887a1f10000
IFAlias: Dest: AMNA austkchr1-ser0/0/1:0.325 Type: FRASI CID: DHEC.531638
IFDescription: ATM9/1/0.325-atm subif
Status: Normal

I want to Join every 5 lines with $ symbol.

Output should be:

IFName: aust00m1.mis.amat.com[ 0 [ 257 ] ]$ObjID: 5eceea48-0d59-71dd-1512-9887a1f10000$IFAlias: Dest: AMNA austkchr1-ser0/0/0:0.315 Type: FRASI CID: DHEC.559128$IFDescription: ATM9/1/0.315-atm subif$Status: Normal

Pls. anybody give me script for this requirement.

Thanks,
Gobinathan.s

awk ' $0 ~ /^Status/ { line =line "$" $0; print line; line= ""; next}
        { if(line == "") {line = $0 } else { line = line "$" $0;}}' <Filename>

Use nawk or /usr/xpg4/bin/awk on Solaris:

awk 'ORS=NR%5?"$":RS' input

Thank you all.

Rado, your script worked well to resolved my requirement.