LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-11-2013, 03:56 PM   #1
readmore
LQ Newbie
 
Registered: Feb 2013
Location: on the park bench.
Distribution: Debian
Posts: 15

Rep: Reputation: Disabled
/bin/sh read user input


Hi,

Have google'd but can't find the answer...

How can I do this (or something equivalent): read -p "Press Enter to Continue"

..when using the /bin/sh interpreter.

read -p works fine on my other system which uses /bin/bash

TIA.
 
Old 10-11-2013, 04:23 PM   #2
kabamaru
Member
 
Registered: Dec 2011
Location: Greece
Distribution: Slackware
Posts: 276

Rep: Reputation: 134Reputation: 134
Does this work?

Code:
#!/bin/sh

printf "Enter something: "
read myvar
echo $myvar

Last edited by kabamaru; 10-11-2013 at 04:25 PM.
 
1 members found this post helpful.
Old 10-11-2013, 04:56 PM   #3
readmore
LQ Newbie
 
Registered: Feb 2013
Location: on the park bench.
Distribution: Debian
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kabamaru View Post
Does this work?
That did it! Thank you
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script to read multiple user input prasunjit Programming 1 03-31-2013 02:09 PM
Using read to prompt for editable user input in Bash 3 woodson2 Programming 4 11-28-2012 11:18 AM
read multiple lines from user input in c archanac07 Linux - Software 1 02-26-2010 05:15 AM
using read and setting variables from user input string tekgek Programming 1 11-27-2008 01:10 AM
how to read more than ten arguments of user input in a script new_2_unix Linux - Newbie 5 11-19-2007 03:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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