Solved

Question about sh bash scripts

Posted on 2003-11-16
2
272 Views
Last Modified: 2013-12-27
Hi,
I'd like to ask about some scripting tricks. How to write a script that will do these tasks:
1.Read from file first line and writes the readed line into variable. 2. How to write variable value into file.

thanks,
0
Comment
Question by:berniunas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 38

Accepted Solution

by:
yuzh earned 100 total points
ID: 9762076
1.Read from file first line and writes the readed line into variable.

MYVAR=`head -1 inputfilename`
echo $MYVAR

2. How to write variable value into file.

echo $MYVAR > outputfile
0
 

Author Comment

by:berniunas
ID: 9762254
thanks
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question