The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
HELP! writing shell script with c++ file deadleg UNIX for Dummies Questions & Answers 1 03-08-2008 10:40 AM
help for a perl script - writing to a data file meghana Shell Programming and Scripting 2 02-04-2008 05:05 PM
script for writing to a file innocent Shell Programming and Scripting 0 01-20-2008 10:15 AM
writing script file for database shaksing Shell Programming and Scripting 3 07-26-2007 09:30 AM
help writing script file lanboy_2005 UNIX for Dummies Questions & Answers 19 03-10-2004 10:58 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-07-2007
Jaken Jaken is offline
Registered User
  
 

Join Date: May 2006
Posts: 17
Writing to a file within a script

Hi,

At the moment i have a script where it asks the user if they want to create a file and what to put in the file. The problem is when the script is run the user inputs the information, though when they are finished typing what they want to be in the file there is no way for the program to know they are finished or the user to exit.

The code that i am using for this currently is:


Code:
echo "\nPlease enter a name of a file that you wish to create"
read file
echo "\nPlease type something that you wish to be inside it\n"                                                                                     
read desc
cat >$file
$desc
echo "Thank you for creating a file"

Thanks for any help.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0