?
Solved

Create text file from BASH script and write to it.

Posted on 2007-08-02
2
Medium Priority
?
15,711 Views
Last Modified: 2012-06-27
Really quick question for the linux BASH shell (making a BASH script).

How do I create a text file ($strFilename)  and how do I append a line of text ($strText) into it?

Thanks guys
0
Comment
Question by:Ryan_R
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 1000 total points
ID: 19616545
> How do I create a text file ..
touch filename

> .. and how do I append a line of text  into it?
echo strText >> filename
0
 
LVL 15

Author Comment

by:Ryan_R
ID: 19616556
Thanks hoff :)
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Suggested Courses

864 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