LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-20-2007, 06:25 PM   #1
monu
LQ Newbie
 
Registered: Jun 2007
Posts: 17

Rep: Reputation: 0
bash character read


Hi, Guys

what is command for read characters? for example:

read -p " please enter your banknumber: " num

if [ $num -eq o ]
then
echo "please enter banknum"

elif [ $num -eq character?


if user enter character for example: please enter your banknumber:ssfsdsf

how do i display error?

thanks
 
Old 10-20-2007, 06:33 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The Advanced Bash Scripting Guide has the answer to all your bash scripting questions.
 
Old 10-20-2007, 08:54 PM   #3
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by monu View Post
Hi, Guys

what is command for read characters? for example:

read -p " please enter your banknumber: " num

if [ $num -eq o ]
then
echo "please enter banknum"

elif [ $num -eq character?


if user enter character for example: please enter your banknumber:ssfsdsf

how do i display error?

thanks
do a loop...
Code:
while [ 1=1 ];
do
read -p " please enter your banknumber: " num
See here
...
..
done
 
Old 10-20-2007, 09:10 PM   #4
monu
LQ Newbie
 
Registered: Jun 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ghostdog74 View Post
do a loop...
Code:
while [ 1=1 ];
do
read -p " please enter your banknumber: " num
See here
...
..
done
thanks i will try that
 
  


Reply

Tags
char



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
Read other language character ust Linux - Software 3 02-20-2009 03:10 AM
Read character problem sunhui Linux - Software 2 01-31-2007 06:27 AM
Bash: How to read tab character when reading input new_to_bash Programming 7 12-09-2006 07:31 PM
Read Chinese character ust Linux - Software 1 05-17-2006 04:53 AM
Read until a certain character? AndreasA Programming 5 08-12-2003 10:24 AM

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

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