Link to home
Start Free TrialLog in
Avatar of Angela_Wilcox
Angela_WilcoxFlag for United States of America

asked on

Read Multi-Line file in as variable

I am not a Unix coder - but I have to create automation scripts for my application.  So I am a hack.  I am trying to figure out a way to read a multi-line text file into a variable to be used in a function.  The text file is 5 time stamps with CR after each I added a final 6th line that says END to the file.  I am trying this command currently:
Until CONTENTS = "END"
read CONTENTS
do
runsetnotecmd;
done < $NoteMsg

Runsetnotecmd reads the $CONTENTS variable and writes it to a note area of my application.  Currently - I get line number 5 directly preceding the END as the variable contents.  I need all 5 lines.
Thank you for your help
Avatar of Angela_Wilcox
Angela_Wilcox
Flag of United States of America image

ASKER

Am I going to have to use an AWK of some sort?

Your problem may be in the runsetnotecmd, the first time it should write the subsequent times it should append.

ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That worked great - thanks