Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Check the value of a string variable Post 302392015 by omonoiatis9 on Wednesday 3rd of February 2010 06:41:04 AM
Old 02-03-2010
ok thank you for your help!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check a string in the variable

hi, I have a variable var1 as follows in the script. var1="one two three desformat=PDF xyz" I would like to check whether $var1 has a string "desformat=PDF" or not. Is there any command I can use (not need to creat a file)? Currently, I am using this: if ( grep "desformat=PDF"... (1 Reply)
Discussion started by: josephwong
1 Replies

2. UNIX for Dummies Questions & Answers

check whether variable number or string

I am passing an argument to a file and i wanna check whether the argument is a number or string ? how can i do this? (4 Replies)
Discussion started by: rolex.mp
4 Replies

3. Shell Programming and Scripting

read string, check string length and cut

Hello All, Plz help me with: I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
Discussion started by: ozzy80
9 Replies

4. UNIX for Advanced & Expert Users

check if a variable contains a string

hi I have an if condition that states: if ; then exit how to translate this? $x is a path $y is a string that comes at the end of the path thx (11 Replies)
Discussion started by: melanie_pfefer
11 Replies

5. UNIX for Dummies Questions & Answers

How to check a particular element in a string variable

Hi, I have a string variable containing value say abc123 I want to check if the 3rd element of this string is "c" in a if statement.Actually i dont know the syntax of how to use substring in an if statement in shell script. Please reply soon. Regards Navjot (3 Replies)
Discussion started by: navjotsingh
3 Replies

6. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

Can someone tell me how I can do this? e.g: a=$(echo -e wert trewt ertert ertert ertert erttert erterte rterter tertertert ert) How do i replace the STRING with $a? I try this: sed -i 's/STRING/'"$a"'/g' filename.ext but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies

7. UNIX for Dummies Questions & Answers

Comparing a String variable with a string literal in a Debian shell script

Hi All, I am trying to to compare a string variable with a string literal inside a loop but keep getting the ./testifstructure.sh: line 6: #!/bin/sh BOOK_LIST="BOOK1 BOOK2" for BOOK in ${BOOK_LIST} do if then echo '1' else echo '2' fi done Please use next... (1 Reply)
Discussion started by: daveu7
1 Replies

8. 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

9. Shell Programming and Scripting

Check file for string existence before appending it with string

I want to append file with a string but before doing that i want to check if this string already exist in that file.I tried with grep on Solaris 10 but unsuccessful.Man pages from grep seems to suggest if the string is found command status will be 0 and if not 1.But i am not finding it.May be i... (2 Replies)
Discussion started by: sahil_shine
2 Replies

10. UNIX for Beginners Questions & Answers

Check if string variable is a subset of another string variable

Below is my ksh shell script where I need to check if variable fileprops is a subset of $1 argument. echo "FILE PROPERTY: $fileprops" echo "PARAMETER3: $1" if ; then echo "We are Good. $line FILE is found to be INTACT !! " else echo... (2 Replies)
Discussion started by: mohtashims
2 Replies
Password(3pm)						User Contributed Perl Documentation					     Password(3pm)

NAME
Data::Password - Perl extension for assesing password quality. SYNOPSIS
use Data::Password qw(IsBadPassword); print IsBadPassword("clearant"); # Bad password - contains the word 'clear', only lowercase use Data::Password qw(:all); $DICTIONARY = 0; $GROUPS = 0; print IsBadPassword("clearant"); DESCRIPTION
This modules checks potential passwords for crackability. It checks that the password is in the appropriate length, that it has enough character groups, that it does not contain the same chars repeatedly or ascending or descending characters, or charcters close to each other in the keyboard. It will also attempt to search the ispell word file for existance of whole words. The module's policies can be modified by changing its variables. (Check "VARIABLES"). For doing it, it is recommended to import the ':all' shortcut when requiring it: use Data::Password qw(:all); FUNCTIONS
1. IsBadPassword(password) Returns undef if the password is ok, or a textual description of the fault if any. 2. IsBadPasswordForUNIX(user, password) Performs two additional checks: compares the password against the login name and the "comment" (ie, real name) found on the user file. VARIABLES
1. $DICTIONARY Minimal length for dictionary words that are not allowed to appear in the password. Set to false to disable dictionary check. 2. $FOLLOWING Maximal length of characters in a row to allow if the same or following. If $FOLLOWING_KEYBOARD is true (default), the module will also check for alphabetical keys following, according to the English keyboard layout. Set $FOLLOWING to false to bypass this check. 3. $GROUPS Groups of characters are lowercase letters, uppercase letters, digits and the rest of the allowed characters. Set $GROUPS to the number of minimal character groups a password is required to have. Setting to false or to 1 will bypass the check. 4. $MINLEN $MAXLEN Minimum and maximum length of a password. Both can be set to false. 5. @DICTIONARIES Location where we are looking for dictionary files. You may want to set this variable if you are using not *NIX like operating system. FILES
o /usr/share/dict/web2 o /usr/share/dict/words o /etc/passwd SEE ALSO
See Data::Password::BasicCheck if you need only basic password checking. AUTHOR
Raz Information Systems, razinf@cpan.org, raz@raz.co.il. COPYRIGHT
Copyright (c) 2001 - 2006 Raz Information Systems Ltd. http://www.raz.co.il/ This package is distributed under the same terms as Perl itself, see the Artistic License on Perl's home page. perl v5.12.3 2011-05-23 Password(3pm)
All times are GMT -4. The time now is 01:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy