LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-29-2004, 06:51 AM   #1
varala_kanth
Member
 
Registered: Feb 2004
Posts: 51

Rep: Reputation: 15
how to creata file through bash script?


hello friends

i need bash script through which

i can create a file , and write some info into it

file name will be command prompt one

the user will fill info in to that file

by storing information into user defined variable

and copying that into the file

so please tell me how to proceed
 
Old 04-29-2004, 07:11 AM   #2
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 900

Rep: Reputation: 153Reputation: 153
A good place to start is http://www.tldp.org/LDP/abs/html/
 
Old 04-29-2004, 02:52 PM   #3
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Code:
#!/bin/bash

echo -n "enter filename: "
read filename
echo -n "enter file contents: "
read content
echo $content > $filename
but yeah, read the advanced bash scripting guide...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing a File in a Bash Script TGWDNGHN Programming 4 12-02-2005 02:38 PM
making a bash script file Berticus Linux - General 1 10-15-2005 11:14 PM
reading file, bash script marri Programming 3 11-15-2004 09:13 AM
Can't get lines of a file with a Bash script.. barisdemiray Programming 2 08-11-2004 12:42 PM
file editing in a bash script Harpune Programming 4 11-22-2002 11:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration