Sponsored Content
Full Discussion: Query on decision making...
Top Forums Shell Programming and Scripting Query on decision making... Post 302475592 by biglau on Monday 29th of November 2010 08:28:27 AM
Old 11-29-2010
Query on decision making...

Code:
is_number()
 {
         echo $1|egrep '^[1-9][0-9]*$' 2>&1 1>/dev/null
         return $?
 }

why the following snippet always give an output as "no" and never "yes" whatever the parameter I give to function is_number?
Code:
if [[ `is_number 0100` ]]; then echo yes; else echo no; fi

In addition, the function is_number() is working fine as per the below command line:
Code:
linux-hhaq:/apps/informatica/current/pmserver/tes/scripts # is_number 100
linux-hhaq:/apps/informatica/current/pmserver/tes/scripts # echo $?
0
linux-hhaq:/apps/informatica/current/pmserver/tes/scripts # is_number 0100
linux-hhaq:/apps/informatica/current/pmserver/tes/scripts # echo $?
1
linux-hhaq:/apps/informatica/current/pmserver/tes/scripts #


Last edited by Scott; 11-29-2010 at 09:42 AM.. Reason: Code tags, please...
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

decision, case, it then else?

I'm writing this script in Korn Shell, on AIX. The script will print a log file, and it needs to decide what region it's in before printing. ( the output of db2 "get instance" is either "The current database manager instance is: db2q" or "The current database manager instance is: db2u") ... (6 Replies)
Discussion started by: jpprial
6 Replies

2. UNIX for Dummies Questions & Answers

Platform decision

Hi folks First, let me apologize in advance for the long message. I know this will sound like a typical "newbie" message but I am really working to understand the technology in order to make informed decisions. I am currently in the process of evaluating Unix hardware and OS platforms for an... (5 Replies)
Discussion started by: Scooter
5 Replies

3. Shell Programming and Scripting

Numerical Decision

I'm tryning to do something like this, I have this file: spaces12tabgoodbye spaces3tabhello I want to copy to another file the lines that have the number above 10... I thought using sort -rn but I don't know how to discard the lines that have the number below 10. Any idea? Thanks (3 Replies)
Discussion started by: pmpx
3 Replies

4. Shell Programming and Scripting

shell script with decision making

Hi all I need help for the issue below. I need to create script: FORM_cmd=query || import FORM_command=add FORM_msisdn=389881234567 FORM_provcode=SK FORM_attr=12 FORM_cmd can be "query" or "import" when FORM_cmd="query" then execute -> spdci -cmd $FORM_cmd FORM_cmd when... (3 Replies)
Discussion started by: vasil
3 Replies

5. Shell Programming and Scripting

Regarding a query on making changes to a running script

Hello All, Greetings !! I have a query here to all is as follows: Question: Let's say we are running a script in a UNIX box and we have opened an another session and then made changes in script of some statements NOT to be print some values(just an example) so when I am monitoring the... (5 Replies)
Discussion started by: RavinderSingh13
5 Replies

6. UNIX for Beginners Questions & Answers

Handling decision making logic

------- Output Screen -------- Choose the option ----------------- 1.Input 2.Output 3.CFT Uniq x.Exit ----------------- 2 Enter the Output flow IDF PBL5572U Enter the Output existing flow IDF PBL5198H sf_PBL5572U.cmd file exist in invalid path or doesn't exist (0 Replies)
Discussion started by: Vijaykannan T
0 Replies
TDFX(4) 						   BSD Kernel Interfaces Manual 						   TDFX(4)

NAME
tdfx -- Voodoo Graphics and VoodooII Memory Access GLIDE device driver SYNOPSIS
device tdfx device tdfx_linux DESCRIPTION
This driver creates an entry in /dev that allows programs (mostly GLIDE-based software) to access the device memory of the Voodoo Graphics and VoodooII 3D accelerators created by 3Dfx, Inc. This provides an interface for applications based on the GLIDE API or that simply use the API provided by the linux /dev/3dfx device to use the video device. Supports all cards based on the following chipsets: 3Dfx Voodoo Graphics 3Dfx Voodoo II Specifically, the following cards should work: Diamond Multimedia Monster 3D Diamond Multimedia Monster 3D II Note that this driver does not currently have support for the Voodoo Banshee, Voodoo3, Voodoo5, or Voodoo6 based cards. It also does not currently support the Voodoo Rush. It also does not yet handle the SLI feature of the Voodoo II boards. You can only use each of them sepa- rately. By including tdfx_linux, you can enable the linux ioctl code for this driver, where the only supported applications currently reside. FILES
/dev/3dfx Symlinked to default 3dfx board /dev/3dfx* Character Device programming interface /dev/voodoo Mirrors of above interfaces /dev/voodoo* (Some apps use /dev/voodoo) HISTORY
The tdfx driver appeared in FreeBSD 5.0, and was originally developed for Linux kernel 2.0.x, later written for 2.2.x and 2.4.x. AUTHORS
The driver was developed by Coleman Kane <cokane@micro.ti.com> after the linux version of this driver by Darryll Straus, John Taylor, Jens Axboe, Carlo Wood <carlo@alinoe.com> and Joseph Kain <joseph@3dfx.com> to be directly compatible with it and support the many GLIDE based games available for Linux and UNIX. BSD
February 19, 2001 BSD
All times are GMT -4. The time now is 08:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy