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 11-14-2008, 09:22 AM   #1
jarodm
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Rep: Reputation: 0
Question User prompt with touch command?


Hello everybody,

Hopefully I've got a simple question for you. I am working on putting together a bash script to automatically gather system information into a file from various commands.

I've got most everything else figured out, but I am wondering if there is a way that I can use the touch command for something like the following:

The script would be executed, and the first step would be a prompt that asks the user for the name of the system they are working on. For example:

What is the name of the system you are currently working on?

The user would then enter the name of the system, and then the touch command would create a file with the name that the user entered.

Is something like this possible? Thanks!
 
Old 11-14-2008, 09:25 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
You need the "read" command, the usage is trivial enough.

Code:
read $VAR
touch "$VAR"
 
Old 11-14-2008, 09:29 AM   #3
jarodm
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
You need the "read" command, the usage is trivial enough.

Code:
read $VAR
touch "$VAR"
Sheesh, that's easy enough. Thanks!!
 
  


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
tips with touch command rajveervashisth Linux - Newbie 2 08-06-2008 01:22 PM
startx command in FC7 reverts me back to the command prompt sriram87 Linux - Newbie 5 01-03-2008 11:18 PM
touch command not found Mystified Linux From Scratch 1 03-28-2005 11:38 AM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 07:14 PM
touch command dominant Linux - Newbie 6 02-17-2004 04:57 PM

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

All times are GMT -5. The time now is 11:05 AM.

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