I'm parsing through a large lslpp -Lc output file with a for loop. The file contains many lines similar to this:
zip:zip-2.3-3:2.3: : :C:R:A file compression and packaging utility compatible with PKZIP.: :/bin/rpm -e zip: : : : :0:
There appears to be no specialized or secret markup in the file.
However, when I try reading through the file in a loop while in a shell script, it breaks up every space as a line break, and each line break as a double break.
Below is the code:
Code:
#!/usr/bin/ksh
for i in `cat -n servername.lpp`
do
echo "$i"
done
The strange thing is that cat does not seem to notice that the lines are being broken up, as indicated by the output below.
I also tried reading in the file with a second
perl script (for i in `
perl perlscript.pl) and got exactly the same problem.
Output from entering the
Output from script file:
Code:
1
#Package
Name:Fileset:Level:State:PTF
Id:Fix
State:Type:Description:Destination
Dir.:Uninstaller:Message
Catalog:Message
Set:Message
Number:Parent:Automatic:EFIX
Locked:Install
Path:Build
Date
2
Java14.sdk:Java14.sdk:1.4.2.175:
:
:C:F:Java
SDK
32-bit:
:
:
:
:
:
:0:0:/:
I've also tried this with bash shell specified. I'm not sure how to resolve this. Any help would be appreciated.