Sponsored Content
Full Discussion: Using bc to assign value
Top Forums Shell Programming and Scripting Using bc to assign value Post 302311456 by navjinder on Tuesday 28th of April 2009 05:41:47 PM
Old 04-28-2009
MySQL

Thanks tyler_durden. A good job done, yea it makes more sense thanks again Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

assign a value to variable

I have to assign a result of a query to a vairable like this how can i do this Query = select count(*) from table x=`db2 ${Query}| sed -n '4p'` but this doesn't work, is there any other way to assign the result without redirecting the result to temp file. . Thanks Mark. (3 Replies)
Discussion started by: markjason
3 Replies

2. Shell Programming and Scripting

How to assign the specific value

Hi Everyone, How to assign the specific value which return from database? here is the return value from database --> (return status = 0) 0 <----- this I only need to get the "0" .. assign to another declare variable. hope someone will help me.. Please thank you.. (4 Replies)
Discussion started by: ryanW
4 Replies

3. Shell Programming and Scripting

Assign a sting to a name?

i want to assign a anme for a string, i got the things below, but it doesn't work. MParc1=`` if then $MPrac1=`Prac1` # assign $MPrac1 to Prac1 else $MPrac1=`` #assigne $MPrac1 to nothing fi echo "${MPrac1} >>file Output: (if num is 0) Prac1 can you please... (6 Replies)
Discussion started by: mingming88
6 Replies

4. Shell Programming and Scripting

Not able to assign a value to variable

Hi Experts, I am facing some problem while developing the script.My input config.csv file contains the three columns namely pathname,filename,filetype.Based on the file type i have to use ftp command that is if filetype=csv then do ftp. The input file is cat config.csv... (13 Replies)
Discussion started by: Amey Joshi
13 Replies

5. Shell Programming and Scripting

Assign the value

DATA --------------- 0 Please tell me, if the file contains 0 after --. then assign the value to variable $var=false, DATA --------------- 1 then $var=true, (2 Replies)
Discussion started by: sandy1028
2 Replies

6. Shell Programming and Scripting

how to assign value

#! /bin/bash if ; then echo "Set number " else k=$1 sqlplus ${scheme}/${apsswd}@${server} @query.sql $k fi file query.sql looks like this select * from tab1 where number =${k}; =================================== it doesnt work my question is how to assign k value in last... (2 Replies)
Discussion started by: kvok
2 Replies

7. Linux

HOW TO assign IP in REDHAT 6?

Hi Guys, It may sound silly questions but I am really confused and forgot the sequence to set IP in REDHAT 6. 1st type system-config-network then I give IP as 192.168.1.78 Subnet as 255.255.255.0 Then do /etc/init.d/network restart Then when I check with ifconfig eth0... (1 Reply)
Discussion started by: manalisharmabe
1 Replies

8. UNIX for Dummies Questions & Answers

Assign dir name

Hi guys i need to assign to a $var the name of a directory i've created before like this: mkdir cd /esb/cargomax/fuse/SMX_SV_$(date +%F) i guess this is very simple, but..... Thanks!! (3 Replies)
Discussion started by: Newer
3 Replies

9. Shell Programming and Scripting

Unable to assign a value

I have written a shell script to calculate dbsize :- db2 "call get_dbsize_info(?,?,?,-1)" | sed -n '8p' | awk -F : '{print $2}' dbsize=`db2 "call get_dbsize_info(?,?,?,-1)" | sed -n '8p' | awk -F : '{print $2}'` echo $dbsize when I execute it the syntax works but it's not... (11 Replies)
Discussion started by: lazydev
11 Replies

10. Shell Programming and Scripting

Check assign

I have a person script which has a following statement. BUILD_FOLDER=$2 i=$((${#BUILD_FOLDER}-1)) if then BUILD_FOLDER=$BUILD_FOLDER/ #echo $BUILD_FOLDER else echo " " #echo $BUILD_FOLDER fi What and how this statement works ? i=$((${#BUILD_FOLDER}-1)) (5 Replies)
Discussion started by: ilugopal
5 Replies
Data::Validate::URI(3pm)				User Contributed Perl Documentation				  Data::Validate::URI(3pm)

NAME
Data::Validate::URI - common url validation methods SYNOPSIS
use Data::Validate::URI qw(is_uri); if(is_uri($suspect)){ print "Looks like an URI "; } else { print "Not a URI "; } # or as an object my $v = Data::Validate::URI->new(); die "not a URI" unless ($v->is_uri('foo')); DESCRIPTION
This module collects common URI validation routines to make input validation, and untainting easier and more readable. All functions return an untainted value if the test passes, and undef if it fails. This means that you should always check for a defined status explicitly. Don't assume the return will be true. The value to test is always the first (and often only) argument. There are a number of other URI validation modules out there as well (see below.) This one focuses on being fast, lightweight, and relatively 'real-world'. i.e. it's good if you want to check user input, and don't need to parse out the URI/URL into chunks. Right now the module focuses on HTTP URIs, since they're arguably the most common. If you have a specialized scheme you'd like to have supported, let me know. FUNCTIONS
new - constructor for OO usage new(); Description Returns a Data::Validator::URI object. This lets you access all the validator function calls as methods without importing them into your namespace or using the clumsy Data::Validate::URI::function_name() format. Arguments None Returns Returns a Data::Validate::URI object is_uri - is the value a well-formed uri? is_uri($value); Description Returns the untainted URI if the test value appears to be well-formed. Note that you may really want one of the more practical methods like is_http_uri or is_https_uri, since the URI standard (RFC 3986) allows a lot of things you probably don't want. Arguments $value The potential URI to test. Returns Returns the untainted URI on success, undef on failure. Notes, Exceptions, & Bugs This function does not make any attempt to check whether the URI is accessible or 'makes sense' in any meaningful way. It just checks that it is formatted correctly. is_http_uri - is the value a well-formed HTTP uri? is_http_uri($value); Description Specialized version of is_uri() that only likes http:// urls. As a result, it can also do a much more thorough job validating. Also, unlike is_uri() it is more concerned with only allowing real-world URIs through. Things like relative hostnames are allowed by the standards, but probably aren't wise. Conversely, null paths aren't allowed per RFC 2616 (should be '/' instead), but are allowed by this function. This function only works for fully-qualified URIs. /bob.html won't work. See RFC 3986 for the appropriate method to turn a relative URI into an absolute one given its context. Returns the untainted URI if the test value appears to be well-formed. Note that you probably want to either call this in combo with is_https_uri(). i.e. print "Good" if(is_http_uri($uri) || is_https_uri($uri)); or use the convenience method is_web_uri which is equivalent. Arguments $value The potential URI to test. Returns Returns the untainted URI on success, undef on failure. Notes, Exceptions, & Bugs This function does not make any attempt to check whether the URI is accessible or 'makes sense' in any meaningful way. It just checks that it is formatted correctly. is_https_uri - is the value a well-formed HTTPS uri? is_https_uri($value); Description See is_http_uri() for details. This version only likes the https URI scheme. Otherwise it's identical to is_http_uri() Arguments $value The potential URI to test. Returns Returns the untainted URI on success, undef on failure. Notes, Exceptions, & Bugs This function does not make any attempt to check whether the URI is accessible or 'makes sense' in any meaningful way. It just checks that it is formatted correctly. is_web_uri - is the value a well-formed HTTP or HTTPS uri? is_web_uri($value); Description This is just a convinience method that combines is_http_uri and is_https_uri to accept most common real-world URLs. Arguments $value The potential URI to test. Returns Returns the untainted URI on success, undef on failure. Notes, Exceptions, & Bugs This function does not make any attempt to check whether the URI is accessible or 'makes sense' in any meaningful way. It just checks that it is formatted correctly. is_tel_uri - is the value a well-formed telephone uri? is_tel_uri($value); Description Specialized version of is_uri() that only likes tel: urls. As a result, it can also do a much more thorough job validating according to RFC 3966. Returns the untainted URI if the test value appears to be well-formed. Arguments $value The potential URI to test. Returns Returns the untainted URI on success, undef on failure. Notes, Exceptions, & Bugs This function does not make any attempt to check whether the URI is accessible or 'makes sense' in any meaningful way. It just checks that it is formatted correctly. SEE ALSO
URI, RFC 3986, RFC 3966, RFC 4694, RFC 4759, RFC 4904 AUTHOR
Richard Sonnen <sonnen@richardsonnen.com>. is_tel_uri by David Dick <ddick@cpan.org>. COPYRIGHT
Copyright (c) 2005 Richard Sonnen. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-03-18 Data::Validate::URI(3pm)
All times are GMT -4. The time now is 10:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy