Solved

Question about sh bash scripts

Posted on 2003-11-16
2
259 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
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

809 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