LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 10: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, 10:25 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

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

Code:
read $VAR
touch "$VAR"
 
Old 11-14-2008, 10: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 08:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration