I'm looking for a script which is testing how complex an "added" string is, for example like the user is changing his password and check how complex it is, if it included letters (lower/upper case), numbers and other characters.Im doing this for password check, the user type's the password and must be 6 characters long, have upper case letters lets say and numbers and so on.If anyone knows where I could find some bash script which is doing this, it would be really cool.
I would like to ask how could I enforce "NT-style" password complexity, for instance, the new password must contain 2 lowercase characters, 2 digits and 1 non-alphabetic character set, on Samba PDC so that while some samba clients change their passwords from Windows XP workstations. I have configured check password script option on samba configuration file, but users could not change password from Windows XP workstations no matter how complicated password they use.
A dialog box said: The password supplied does not meet the minimum complexity requirements. Please select another password that meets all of the following criteria: is at least 5 characters; has not been used in the previous 0 passwords; does not contain your account or full name; contains at least three of the following four character groups:
English uppercase characters (A through Z); English lowercase characters (a through z); Numerals (0 through 9); Non-alphabetic characters (such as !, $, #, %)
I want to test whether or not my phone is connected from bash. I'm finding lots of information about /dev/rfcomm0, but that's not on my system (Ubuntu 10.04). The device pairs just fine, and I can connect with gammu just fine, and I have the device address ("00:1F:5D:37:17:FB").I just need something I can put in a bash script to say "Is this connected or not" akin to testing for a file's existence:
Code: if [ -f /home/steven/arbitrary filename ] then
I have searched and searched in regards to this documented 'special expression '-l STRING' for the 'test' command, and to no avail, have I found out why it does not work on my system.
The example always given is: Code: test -l abc -gt 1 && echo yes And the returned result is: Code: bash: test: -l: unary operator expected The documention is usually as follows: Numeric tests
Numeric relationals. The arguments must be entirely numeric (possibly negative), or the special expression `-l STRING', which evaluates to the length of STRING. Then examples are given, including the one I provided above. Does anyone else have this issue of getting an error when trying this special expression of 'l STRING' ???
I have the following function that does not iterate through the array I want to be able to do some manipulation on each element in the array[@].it appears the below array has only one item in the array whereas i want the array to have 3 items hence the loop three times printing the message Any ideas why this is not happening ?
Is there any inbuilt functionality in Unix shell script so that i can able to convert lower case string input to an upper case? I dont want to use high level languages like java,python or perl for doing the job.
I have a file (.tmpfile) and inside it is a string which i only know part of, the rest being a random group of characters... I would like to know how to pull the whole string out of the file and into a variable.
I'm currently learning bash programming and am trying to create a program to maintain a list of people. Here is the code so far:
#!/bin/bash # Namelist clear
As you can see, I attempted to build in a protective measure to prevent duplicate entries using "if grep -Fxq "$FN $LN" /home/andrea/namelist.txt", FN and LN being first name and last name as you can see in the first read operation. However, this fails to actually work. Demonstrations:
It saves the details to the file rather than displaying the error message, or in other words, it doesnt check the file properly.
I look after a server which accepts automatic overnight PASV FTP uploads from remote clients. When the uploads are complete, my Bash script copies the files to another location. The problem is, my script needs to be a bit smarter when it comes to detecting active FTP sessions.
I was using:
netstat -n | grep ":21 " | grep ESTABLISHED
to test if there were active sessions, but came unstuck when a local user left an unrelated FTP session active. The result - my script hung around all night thinking there was an active upload from a remote client. My server is behind a firewall, so remote clients all show an internal (NAT) address,so I can't differentiate by source IP address.I can't install LSOF or FUSER for security reasons. Is there a way I can test for active FTP sessions from specific users? I am running Red Hat Enterprise Linux Server release 5.2 (Tikanga).
I'm trying to write a script where I want to check if any of the parameters passed to a bash script match a string. The way I have it setup right now is if [ "$3" != "-disCopperBld" -a "$4" != "-disCopperBld" -a "$5" != "-disCopperBld" -a "$6" != "-disCopperBld"]but there might be a large number of parameters, so I was wondering if there is a better way to do this?EDIT:I tried this chunk of code out, and called the script with the option, -disableVenusBld, but it still prints out "Starting build". Am I doing something wrong?