Sponsored Content
Top Forums Shell Programming and Scripting Checking the password thru Regex via Shell Script Post 302354526 by durden_tyler on Friday 18th of September 2009 11:57:10 AM
Old 09-18-2009
Code:
$
$ cat testpswd.txt
Ab~18b-y
abcd
1234
bi!n!go
!~!~^#()
!~ab^#()
!~abcde)
Ro!ad&wy
Ro!m$&#y
$
$ ##
$ cat testpswd.txt |
> perl -nle 'printf("%-10s\t",$_);
>            if(/[a-zA-Z]+/ && /[^a-zA-Z]+/ && !/[0-9a-zA-Z]{3,}/){
>              print "Valid";
>            } else {
>              print "Invalid";
>            }'
Ab~18b-y        Invalid
abcd            Invalid
1234            Invalid
bi!n!go         Valid
!~!~^#()        Invalid
!~ab^#()        Valid
!~abcde)        Invalid
Ro!ad&wy        Valid
Ro!m$&#y        Valid
$
$

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Checking the valid paths in the shell script

Hi i am using a shell script for renaming the files and placing in the remote location(FTP) my code is: cd $1 day=$(date +%d) for i in `ls -1 BBW*` do last=`tail -1 $i` pat=`expr "$last" : '.*(\(.*\)).*'` pat=`echo $pat | sed 's/ /_/'` pat=$pat$day mv $i $pat rm -f $day done... (3 Replies)
Discussion started by: srivsn
3 Replies

2. Shell Programming and Scripting

checking exit status of a shell script

Hi, I have tried with the following code; if ;then echo "Failure." else echo "Success." fi to test the exit status of the test.ksh shell script. But whatever is the exit status of the test.ksh shell script Failure. is always printed. Please help. regards, Dipankar. (2 Replies)
Discussion started by: kdipankar
2 Replies

3. Shell Programming and Scripting

Checking Files with a Shell Script

Hey everyone, I'm writing a shell script that needs to loop thru a directory and check a defined type of files(.df). I use "checkfile.x" which is a compiled program to check those files. Sintaxis : checkfile.x DatefileName.df The program displays something like this: File: kanswer.df -... (1 Reply)
Discussion started by: Testing_Yorsh
1 Replies

4. Shell Programming and Scripting

Regularly checking with shell script

Hi, I am new in scripting and also in Linux. I wrote my first script recently. I have an external hdd connected to my debian machine. I am spinning it down using a spindown code (code.google.com/p/spindown/)when I am not using it ( automatically after 1 hour). The problem was I wanted to know when... (2 Replies)
Discussion started by: aspedisca
2 Replies

5. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

6. SCO

Stop boot system at "Checking protected password and checking subsystem databases"

Hi, (i'm sorry for my english) I'm a problem on boot sco unix 5.0.5 open server. this stop at "Checking protected password and checking subsystem databases" (See this image ) I'm try this: 1) http://www.digipedia.pl/usenet/thread/50/37093/#post37094 2) SCO: SCO Unix - Server hangs... (9 Replies)
Discussion started by: buji
9 Replies

7. Shell Programming and Scripting

shell or perl script using grep and regex

Hi, I have file stored in a directory containing information about subnet mask and next hop address in the following format 10.1.1.0/16, 255.255.0.0, 10.1.1.1 10.1.2.0/16, 255.255.0.0,10.1.2.1 here 10.1.1.0/16 represent range of ip address 10.1.1.1-10.1.1.16 given say an IP address... (1 Reply)
Discussion started by: termeric
1 Replies

8. Shell Programming and Scripting

Shell Script for continuously checking status of a another script running in background, and immedia

Hi, I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help.. i am using below command to run script nohup system_traps.sh & but in some... (9 Replies)
Discussion started by: ketanraut
9 Replies

9. Shell Programming and Scripting

Service checking through shell script

I want to check the postgres service for client PC which is remotely placed through shell script , whether the Postgres service is working or not.I don't have an idea to develop this script.Please give me a code. Client PC IP Address: 10.66.1.133 (2 Replies)
Discussion started by: kannansoft1985
2 Replies

10. Shell Programming and Scripting

Help me with C-shell Script: Disk checking

Hi, i am new in shell script. i have given a task to make a C-shell script. I have list of ip address and device name respectively. For example; cal 1 : 100.21.25.10 cal 2 : 100.21.25.11 cal 3 : 100.21.25.12 cal 4 : 100.21.25.14 and so on... Right now, i have this. #! /bin/csh -f ... (0 Replies)
Discussion started by: lattey
0 Replies
PTHREAD_SCHEDPARAM(3)					   BSD Library Functions Manual 				     PTHREAD_SCHEDPARAM(3)

NAME
pthread_setschedparam, pthread_getschedparam -- thread scheduling parameter manipulation LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread.h> int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param); int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param); DESCRIPTION
The pthread_setschedparam() and pthread_getschedparam() functions set and get the scheduling parameters of individual threads. The schedul- ing policy for a thread can either be SCHED_FIFO (first in, first out), SCHED_RR (round-robin), or SCHED_OTHER (timesharing). Valid thread priorities (accessed via param->sched_priority) must be within the range returned by the sched_get_priority_min(2) and sched_get_priority_max(2) system calls. RETURN VALUES
If successful, these functions return 0. Otherwise, an error number is returned to indicate the error. ERRORS
The pthread_setschedparam() function will fail if: [EINVAL] Invalid value for policy. [ENOTSUP] Invalid value for scheduling parameters. [ESRCH] Non-existent thread thread. The pthread_getschedparam() function will fail if: [ESRCH] Non-existent thread thread. SEE ALSO
sched_get_priority_max(2), sched_get_priority_min(2) STANDARDS
The pthread_setschedparam() and pthread_getschedparam() functions conform to Version 2 of the Single UNIX Specification (``SUSv2''). BSD
October 16, 2006 BSD
All times are GMT -4. The time now is 03:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy