For kicks I wrote up a Password generator after lunch. Let me start with the code:
( all there upon request )
Now this works just fine without issues but if I specify my array 'password' to be of say size 9 the program starts returning values not within the 'pwd' array.
Ive had it return quotes brackets and a bunch of various non printables.
why do inode indices starts from 1 unlike array indexes which starts from 0
its a question from "the design of unix operating system" of maurice j bach
id be glad if i get to know the answer quickly
:) (0 Replies)
brothers why inode index starts from 1 unlike array inex which starts from 0
its a question from the design of unix operating system of maurice j.bach
i need to know the answer urgently...someone help please (1 Reply)
hi folks
i am facing problom while trying to access sql variable as array index ina unix shell script....script goes as below..
#!/bin/ksh
MAX=3
for elem in alpha beeta gaama
do
arr=$elem
((x=x+1))
Done
SQL_SERVER='servername'
/apps/sun5/utils/sqsh -S $SQL_SERVER -U user -P pwd -b -h... (1 Reply)
Hi,
I'm just trying to use a dynamic index for some array elements that I'm accessing within a loop. Specifically, I want to access an array at variable position $counter and then also at location $counter + 1 and $counter + 2 (the second and third array positions after it) but I keep getting... (0 Replies)
I have an 10 element array containing numbers, I want the start and end index in the array for which the values lie between DIST1 and DIST2. It is not working quite right. I also might want a value of 0 if I cannot find an index.
V=(/10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0/)
... (4 Replies)
Hi Everyone !
I have two files with the same configuration
and I want to multiply corresponding values and write the result in a file.
Let say 2 header lines and then lines of values (with not constant number of columns):
more file1.txt -->
BLABLABLA
BLABLABLA
1 2 3 4
1 2 3
1 2
1... (7 Replies)
I want to return a char array to the main() function, but its returning garbage value.
#include<stdio.h>
//#include<conio.h>
#include<string.h>
char* strtrmm();
int main()
{
char str1,c1;
printf("\n Enter the string:");
gets(str1);
//strtrmm(str1);
printf("%s",strtrmm(str1));... (2 Replies)
I am trying to assign indexes to an associative array in a for loop but I have to use an eval command to make it work, this doesn't seem correct I don't have to do this with regular arrays
For example, the following assignment fails without the eval command:
#! /bin/bash
read -d "\0" -a... (19 Replies)
Hello,
I have a complicated situational find and replace that I wrote in bash because I didn't know how to do everything in awk. The code works but is very slow, as expected.
To create my modified file, I am looping through an array that was populated earlier and making some replacements at... (6 Replies)
Discussion started by: LMHmedchem
6 Replies
LEARN ABOUT OSF1
randomword
randomword(3) Library Functions Manual randomword(3)NAME
randomword, randomchars, randomletters - Generate random passwords (Enhanced Security)
LIBRARY
Security Library - libsecurity.so
SYNOPSIS
int randomchars( char *string, unsigned short int minlen, unsigned short int maxlen, boolean restrict, long seed);
int randomletters( char *string, unsigned short int minlen, unsigned short int maxlen, boolean restrict, long
seed);
int randomword( char *word, char *hyphenated_word, unsigned short int minlen, unsigned short int maxlen, boolean
restrict, long seed);
PARAMETERS
Points at a user-supplied space to contain a null-terminated password. Specifies the minimum length that a generated word can have. Spec-
ifies the maximum length that a generated word can have. Specifies whether restrictions are to be imposed on the generated word. This is
a boolean integer, where a non-zero integer indications restrictions and a 0 (zero) indicates no restrictions. Specifies an initial seed
for the random number generator. Points at a user-supplied space to contain a null-terminated random pronounceable password. Contains the
hyphenated version of the generated word.
DESCRIPTION
These functions generate random passwords for use in password selection. All of them are generated by the system, based on seeds and set
in the function. Such seeds can be created with the drand48(), rand(), or random() functions.
The randomchars() function places a null-terminated password composed of random printable ASCII characters into the string parameter and
returns the length of the generated string. The minlen parameter can equal maxlen, but cannot be greater than maxlen, and cannot be nega-
tive. The user space preallocated is at least maxlen for string. The smaller minlen and maxlen are, the smaller the selection space of
random words.
The restrict parameter is 0 (zero) when no restrictions are placed on the generated word. It is nonzero when the words generated pass the
tests of the acceptable_password() function.
The seed parameter is used by the function only on the first time it is called; the parameter is ignored on subsequent calls.
The randomletters() function places a null-terminated password composed of random lower-case letters into the string parameter and returns
the length of the generated word. The minlen, maxlen, restrict, and seed parameters are the same as for the randomchars() function.
The randomword() function places a null-terminated random pronounceable password into the word parameter and returns the length of the gen-
erated word. The minlen, maxlen, restrict, and seed parameters are the same as for the randomchars() and randomletters() functions. The
user space preallocated is at least 2*max - 1 for hyphenated_word.
NOTES
The password generator relies on a random number generator that produces uniformly distributed integers. Because the password generator
invokes the random number generator many times even for one word, the random number generator has to produce a uniform distribution. The
period (distinct numbers produced given a particular seed) and number space (range of possible numbers) must both be large. The drand48()
functions are used for this purpose.
Programs using these functions must be compiled with -lsecurity.
FILES
System password file. System group file.
RELATED INFORMATION
Functions: acceptable_password(3), drand48(3), rand(3), random(3).
Commands: login(1), passwd(1). delim off
randomword(3)