Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-14-2008, 09:22 AM   #1
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
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

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

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

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

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


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 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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:18 AM.

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