LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   echo command (https://www.linuxquestions.org/questions/linux-general-1/echo-command-932170/)

Micky12345 03-01-2012 09:38 AM

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?

catkin 03-01-2012 10:06 AM

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

What do you want the code to do?


All times are GMT -5. The time now is 05:37 AM.