Shell script ! - TechRepublic
General discussion
April 4, 2003 at 12:20 AM
vavazquez652

Shell script !

by vavazquez652 . Updated 23 years, 3 months ago

I’m trying to create an unix script shell for reading a file with this text:

Example:
1 Error log not found!
2 Error on file!
3 Error on permissions!

And this my script shell:

A=’cat file’
for in in $A
do
echo $i
done

the information displayed on my screen is this:
1
Error
log
not
found!
2
Error
on
file!
3
Error
on
permissions!

And what I need is the information displayed in the followinf format:
1 Error log not found!
2 Error on file! 3 Error on permissions!

How can I keep it together or just the message in the variable.

Thank you for your help

This discussion is locked

All Comments