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
System Programming

Avatar of undefined
Last Comment
Angela_Wilcox

8/22/2022 - Mon
ASKER
Angela_Wilcox

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


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

ASKER CERTIFIED SOLUTION
ozo

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Angela_Wilcox

That worked great - thanks
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck