We help IT Professionals succeed at work.
Get Started

Read Multi-Line file in as variable

Angela_Wilcox
on
1,098 Views
Last Modified: 2013-12-26
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
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE