Hi Folks,
I'm using bash script. I would like to check whether input is a number or not.(Only positive numbers).. if space or non numeric is entered, it should say "invalid input". pls help..
thanks in adv.
Br///
Vijay. (1 Reply)
Hi,
I have a 5 gig file, no record terminators, field terminators are newline. The record length is 768 and I would like to check that every 768th byte is a newline and print out the byte position if it isn't. I would like to do this going either forward or backwards with one command if... (3 Replies)
the script on excution should take a directory path from useran a numric input and it should check indicate whether its write or not?
if the cmmd sh<script-name>,dir/path.<500>" is greater than 500 in size should be copied to dir ,temp in pwd and display the mesage'files of 2000 bytes hav been... (4 Replies)
1. The problem statement, all variables and given/known data:
The script usage will be as follows:
library.third source_directory
- Your script will display an appropriate error message and exit with status 3 if no parameters are given
- Your script will display an appropriate error... (2 Replies)
Hi All,
I am a newbie...I would like to have a function which ll check if a file contains valid strings before "=" operator. Just to give you my requirement:
assume my file has content:
hello= gsdgsd sfdsg sgdsg sgdgdg
world= gggg hhhh iiiii
xxxx= pppp ppppp pppp
my... (5 Replies)
How to check the user input to be valid using shell script?
The valid input is in the format like as follows.
1. It can only have r,w,x or a hyphen and nothing else.
2. ensure the r, w, x are in the correct order.
for example: rwxr-xr-x is a valid format.
Thanks (5 Replies)
I need a script that should print 'yes' if the argument is a valid shell variable name else 'No' if it is not a valid shell variable. A valid one begins with an alphabet or percentage (%) character and is followed by zero or more alphanumberic or percentage (%) characters.
For example:
$... (6 Replies)
How can I validate if time (HH:MM:SS) argument is valid? I got this from web but I can't modify it to exit the script if the time argument is invalid.
echo $1 | awk -F ':' '{ print ($1 <= 23 && $2 <= 59 && $3 <= 59) ? "good" : "bad" }'
ex:
./script.ksh 12:34:21 = okay
./script.ksh... (10 Replies)
Hello,
I am trying to develop a script to check for valid hostnames. Below are the prerequisites for a valid hostname which I got from wiki :
Hostnames are composed of series of labels concatenated with dots, as are all domain names. For example, "en.wikipedia.org" is a hostname. Each label... (8 Replies)
Discussion started by: rahul2662
8 Replies
LEARN ABOUT MINIX
crypt
CRYPT(3) Library Functions Manual CRYPT(3)NAME
crypt - one-way password encryption function
SYNOPSIS
#define _MINIX_SOURCE 1
#include <unistd.h>
char *crypt(const char *key, const char *salt)
DESCRIPTION
The first use of crypt() is to encrypt a password. Its second use is to authenticate a shadow password. In both cases crypt() calls
pwdauth(8) to do the real work.
Crypt() encrypts a password if called with a user typed key, and a salt whose first two characters are in the set [./0-9A-Za-z]. The
result is a character string in the [./0-9A-Za-z] alphabet of which the first two characters are equal to the salt, and the rest is the
result of encrypting the key and the salt.
If crypt() is called with a salt that has the form ##user then the key is encrypted and compared to the encrypted password of user in the
shadow password file. If they are equal then crypt() returns the ##user argument, if not then some other string is returned. This trick
assures that the normal way to authenticate a password still works:
if (strcmp(pw->pw_passwd, crypt(key, pw->pw_passwd))) ...
If key is a null string, and the shadow password is a null string or the salt is a null string then the result equals salt. (This is
because the caller can't tell if a password field is empty in the shadow password file.)
The key and salt are limited to 1024 bytes total including the null bytes.
FILES
/usr/lib/pwdauth The password authentication program
SEE ALSO getpass(3), getpwent(3), passwd(5), pwdauth(8).
NOTES
The result of an encryption is returned in a static array that is overwritten by each call. The return value should not be modified.
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
CRYPT(3)