LinuxQuestions.org
Review your favorite Linux distribution.
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 03-01-2012, 09:38 AM   #1
Micky12345
Member
 
Registered: Feb 2012
Posts: 58

Rep: Reputation: Disabled
echo command


i have written a code
Quote:
for x in $*
do
echo $x | grep "^[0-9]*$"
if [ $? -eq 0 ]
then
echo $?
fi
here in the above oode its searching for a number and displaying properly the value of $?
But problem is if the argument is a numeric one it displays the number also else its not dispalying

can any one exaplin why so nd how can i rectify that?
 
Old 03-01-2012, 10:06 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Please use CODE tags for code, most easily by using Advanced mode and using the # button.

What do you want the code to do?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Echo Command Dougj75 Linux - Newbie 2 02-28-2012 07:09 PM
echo command vinothaa Linux - Newbie 5 06-05-2010 08:15 AM
echo command mohit_parihar Linux - General 3 01-12-2010 06:54 AM
Command echo Corrado Linux - Newbie 3 11-11-2009 06:44 PM
echo command s_hcl Linux - General 1 09-06-2006 05:27 AM

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

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
Open Source Consulting | Domain Registration