Bash : Check aphanumeric content in variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bash : Check aphanumeric content in variable
Prev   Next
# 1  
Old 11-23-2009
Bash : Check aphanumeric content in variable

Hello everyone, I'm trying the best way to implement a check on a variable ... in particular I need to assess the content of characters [a-zA-Z] and numbers [0-9], I tried on various manuals bash scripting but I could not figure out how to do ... any help?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to send to perl the content of a bash variable as argument?

I want to send the content of a bash variable as a python argument for processing. The problem is that bash doesn't "expand" the content, just sends the expression. script.sh#!/bin/bash export RECEIVEDDATE=$(date +"%Y%m%d.%H%M%S") perl checkdate.py checkdate.pyimport datetime import os... (3 Replies)
Discussion started by: Tribe
3 Replies

2. Shell Programming and Scripting

Check content

I would like to write a shell script to do the following , would advise how to make it ? very thanks 1. Connect LDAP server ( Id : user , password : pass ) 2. check the field "user_account_create_date" in the LDAP server , the format of data in this field in LDAP is ABC20130922 ( 22 Sep ,... (3 Replies)
Discussion started by: ust3
3 Replies

3. Shell Programming and Scripting

Check content of file

Hi All, I m very new to unix...i jus want to chk the content of file. ma requirement is if file has a content then display it else dont display or something pls specify which loop shalli use either for or while?? (20 Replies)
Discussion started by: navsan
20 Replies

4. Shell Programming and Scripting

Adding Content to Variable (bash)

is this possible? its kind of like incrementing the value of a number in a variable. but in this case, instead of the value of the variable being a number, it's just contents/strings/characters/alpha-numeric etc. NOT a number. For instance: VAR=Tommy for all in $(blah blah) do ... (2 Replies)
Discussion started by: SkySmart
2 Replies

5. Shell Programming and Scripting

korn shell: check the content of a string of a variable

hello, i have a variable which should have following content : var="value1" or var="value2" or var="value2:*" # example: value2:22 how can i check : - if the content is ok (value1 / value2* ) - the two options of "value2" when content is example "value2:22" , i want to split... (3 Replies)
Discussion started by: bora99
3 Replies

6. Shell Programming and Scripting

Can i use grep to check variable content correctnes?

I need to know if is possible to use grep to check content of a local variable, for eg. i use read index and i want to check if the index i read is in correct form, how do i do that i tried with grep but i get errors all the time dont know how to make it work.. thanks! (3 Replies)
Discussion started by: Goroner
3 Replies

7. UNIX for Dummies Questions & Answers

check length content existence of variable

hi guys, im learning so be gentle... i'm wanting to write a script to read in a customer number. in order that the code is robust i want to check 1) the length of the value entered (4 characters) 2) that all characters entered are numeric between the values 1 to 3 3) that a value is... (1 Reply)
Discussion started by: skinnygav
1 Replies

8. Shell Programming and Scripting

To check the content of one file in another

Hi , I have a file called "X" . the content of X are X -- abc def and i have a file called "Y" , the content of Y are Y -- erty sdss s abc sfs def I need to check if the content of file X is contained in Y.Only unix (7 Replies)
Discussion started by: giri_luck
7 Replies

9. Shell Programming and Scripting

How to check if two variable are empty strings at once? (bash)

I need to check if $1 or $2 are empty before continuing but I don't know if bash has any logic of the sort. This is what I'm looking for - except that "and" doesn't seem to work. if and ;then ... Thank you! :D (4 Replies)
Discussion started by: ph0enix
4 Replies

10. Shell Programming and Scripting

[bash] Check if variable is set or blank

Hello guys. In my script, i have the following code: echo "The tarfile contains these directorys" tar -tf file.tar > tarlist.txt cat tarlist | awk -F/ '{print $1 "/" $2}' | nl echo "Enter path of the directory you want to extract or just press enter to extract everything: " read path... (1 Reply)
Discussion started by: noratx
1 Replies
Login or Register to Ask a Question
XML::Easy::Content(3pm) 				User Contributed Perl Documentation				   XML::Easy::Content(3pm)

NAME
XML::Easy::Content - abstract form of XML content SYNOPSIS
use XML::Easy::Content; $content = XML::Easy::Content->new([ "foo", $subelement, "bar", ]); $twine = $content->twine; DESCRIPTION
An object of this class represents a chunk of XML content, the kind of matter that can be contained within an XML element. This is in an abstract form, intended for general manipulation. It is completely isolated from the textual representation of XML, and holds only the meaningful content of the chunk. The data in a content object cannot be modified: different data requires the creation of a new object. An XML content chunk consists of a sequence of zero or more characters and XML elements, interspersed in any fashion. Character content can use almost all Unicode characters, with only a few characters (such as most of the ASCII control characters) prohibited by the specification from being directly represented in XML. Each XML element in a content chunk itself recursively contains a chunk of content, in addition to having attached metadata. This class is not meant to be subclassed. XML content is unextendable, dumb data. Content objects are better processed using the functions in XML::Easy::NodeBasics than using the methods of this class. CONSTRUCTOR
XML::Easy::Content->new(TWINE) Constructs and returns a new content chunk object with the specified content. TWINE must be a reference to an array listing the chunk's content in twine form (see "Twine" in XML::Easy::NodeBasics). The content is checked for validity, against the XML 1.0 specification, and the function "die"s if it is invalid. METHODS
$content->twine Returns a reference to an array listing the chunk's content in twine form (see "Twine" in XML::Easy::NodeBasics). The returned array must not be subsequently modified. If possible, it will be marked as read-only in order to prevent modification. $content->content Deprecated alias for the "twine" method. SEE ALSO
XML::Easy::Element, XML::Easy::NodeBasics AUTHOR
Andrew Main (Zefram) <zefram@fysh.org> COPYRIGHT
Copyright (C) 2008, 2009 PhotoBox Ltd Copyright (C) 2009, 2010, 2011 Andrew Main (Zefram) <zefram@fysh.org> LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-11-16 XML::Easy::Content(3pm)