LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2004, 09:31 AM   #1
linuxdev
Member
 
Registered: Feb 2004
Posts: 34

Rep: Reputation: 15
Getting user input and updating file


hey all

I am trying to write a script which can take input from user-- like version number,
patch files etc and then should be able to add these files in the desired location
of my file(where I want inputs to be added)

Any clues how to due that....or any reference book to look for this particular
requirement...

Thanks all
 
Old 02-24-2004, 02:22 PM   #2
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 32
Try this:
###
#!/bin/bash
echo "Enter filename to update: "
read filename
echo "Enter what to add: "
read upd
echo $upd >> $filename
###

Last edited by ivanatora; 02-24-2004 at 03:15 PM.
 
  


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
Bash scripting and user input Woodsman Slackware 13 11-02-2005 02:20 PM
How to disable F11 user input? jpan Linux - General 3 09-17-2004 03:28 AM
validating user input blanks Programming 3 09-02-2004 03:47 PM
Shell script user input tuckermaddox Linux - Newbie 5 08-12-2004 03:14 AM
User input using a BASH script... causticmtl Programming 5 07-13-2003 09:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:54 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