Sponsored Content
Full Discussion: Files validation
Top Forums Shell Programming and Scripting Files validation Post 302708155 by the_gripmaster on Monday 1st of October 2012 06:56:08 AM
Old 10-01-2012
Quote:
Originally Posted by sv0081493
Hi,

I want a script to do the following:

1)I want to find all latest files with extension *.doc and write those files to a log file which i did.
my script: find *.doc -mtime -1 -ls > test.log

2) suppose if there is no such latest files extracts script should write "Server password expires" to log file(test.log)

your prompt help will be much appreciated please.

Code:
find *.doc -mtime -1 -ls > test.log

if [ $? -ne 0 ]; then
  echo "Server password expires" >> test.log
fi

This User Gave Thanks to the_gripmaster For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

validation of data using filter (awk or other that works...) in csv files

Hello People I have the following file.csv: date,string,float,number,boolean 20080303,abc,1.5,123,Y 20080304,abc,1.2,345,N 20080229,nvh,1.4,098,Y 20080319,ugy,1.9,586,N 20080315,gyh,2.4,345,Y 20080316,erf,3.1,932,N I need to filter the date field where I have a data bigger than I... (1 Reply)
Discussion started by: Rafael.Buria
1 Replies

2. Shell Programming and Scripting

Date Validation:

Hi I have below file with 3 rd column as date ....i want to make 3 column to mm/dd/yyyy . in the below file 2 row date is like 1/23/1994 so i want to append '0' to month i,e. 01/23/1994 and in the 3 row date is like 6/4/1994 ---so i want this to 06/04/1994 Source:... (1 Reply)
Discussion started by: satyam_sat
1 Replies

3. UNIX for Dummies Questions & Answers

Validation

I'm kinda new in shell scripting. How do i validate an input from a user to conform to requirement. For example, echo "Enter First Name: " read FName echo "Enter Date of Employment (dd/mm/yyyy): " read DoE If the user enters data that is alphanumeric, it accepts it. I hope i've... (1 Reply)
Discussion started by: Allenzo
1 Replies

4. Shell Programming and Scripting

Validation help

Hi, I am new to Unix shell scripting and need help to add some validation to an existing script. I've made a script that takes two argument (input) but I want the script to display an error message when nothing (null) is entered. So far I managed to validate the fist argument but fail to... (2 Replies)
Discussion started by: zen10
2 Replies

5. Shell Programming and Scripting

Name validation

Hi All, I need to write a small piece of code to check the following. name should contain (A-Z), spaces, hyphens & apostrophes I need to generate regular expressions for the same. Please help me out as i am not familiar with regular expressions. (1 Reply)
Discussion started by: lifzgud
1 Replies

6. Shell Programming and Scripting

Validation of variable

Hey people, I got small little error which says I entered too many argument in the if else list. The stock contains a list of information. The 4th field consist of the quantity available, so I'm trying to alert the user that the stock is less than 3 and needed to restock. Is this the correct way... (7 Replies)
Discussion started by: aLHaNz
7 Replies

7. Shell Programming and Scripting

Value validation

Hi All I am trying to validate a value using if condition requirement is need to check whether its a valid numeric value the input contains ( space, #N/A and negative and positive decimal values and Zeros) if it contains the space, I need to display the error message as space ... (15 Replies)
Discussion started by: tsurendra
15 Replies

8. UNIX for Dummies Questions & Answers

Date column validation in files

HI, i have to do some file validations on which i am receving daily.could any one please let me know how we can able to do validations on below scenarios 1) On Date column Ex If i am receving date in format of YYYYMMDD---- 20141118 --- here i have to check the date value 20141142 if the... (7 Replies)
Discussion started by: bhaskar v
7 Replies

9. What is on Your Mind?

Date validation

Hi folks, I new to shell script . I want to know how to validate a String as valid date example: 20150712 ---> valid date 20160524-->valid 201605T12-->invalid date 12341234--->invalid date we need to valid string( yyyymmdd) to date in SunOS 5.10 please give some idea to validate... (9 Replies)
Discussion started by: srinadhreddy27
9 Replies

10. UNIX for Beginners Questions & Answers

Validation using While and IF

I am learning Shell scripting on own. I am trying to do an assignment to get details from the user like username their individual marks ,DOB and send a report in mail with the Details calculated like total and average. validate_marks() { local Value=$1 if && then return 0 else... (1 Reply)
Discussion started by: JayashreeRobin
1 Replies
PasswordService(8)					    BSD System Manager's Manual 					PasswordService(8)

NAME
PasswordService -- Mac OS X Server Password Server daemon SYNOPSIS
PasswordService [-help | -ver] PasswordService [-n] DESCRIPTION
In the first synopsis form, PasswordService prints a usage summary or version information and quits. In the second form, PasswordService acts as a password server. PasswordService must be run as root; it will exit otherwise. If there is another instance of PasswordService running, it will exit. The PasswordService daemon acts as the gatekeeper for user passwords and provides an authentication resource for all services running on the system. The standard way to communicate with PasswordService is to use the DirectoryService API. Services authenticate via the dsDoDirN- odeAuth() function call. If the user being authenticated has an AuthenticationAuthority attribute that begins with ";ApplePasswordServer;" the request is routed to PasswordService for authentication. Normally, the users in an Open Directory LDAP server are managed through Pass- wordService. The DirectoryService buffer formats for each authentication mechanism are documented in the DirServicesConst.h header file. Some of the common methods supported are: APOP, CRAM-MD5, DIGEST-MD5, MS-CHAPv2, NTLMv2 and NTLMv1. Some authentication methods require recoverable passwords. If APOP, TWOWAYRANDOM, or WEBDAV-DIGEST are enabled, the password database must contain recoverable passwords. The PasswordService daemon enforces password policies, such as the minimum number of characters allowed or when a password change is required. See pwpolicy(8) for more information about password policies. PasswordService writes three log files; the server log contains all significant activity; the replication log contains information about syn- chronization with other password servers; the error log contains major error conditions. OPTIONS
The following options are available: -n Do not daemonize. USAGE
In typical usage, PasswordService is launched during the boot process by launchd. To start and stop PasswordService manually, use launchctl(8) commands. This command updates the configuration files and effect the startup state. FILES &; FOLDERS /usr/sbin/PasswordService - the password service daemon /Library/Logs/PasswordService/ApplePasswordServer.Error.log - the error log /Library/Logs/PasswordService/ApplePasswordServer.Replication.log - the replication log /Library/Logs/PasswordService/ApplePasswordServer.Server.log - the activity log /var/db/authserver/authservermain - password database (guard this) /var/db/authserver/authserverfree - list of free (reusable) slots in the database SEE ALSO
mkpassdb(8) launchctl(8) pwpolicy(8) Mac OS X Server 21 February 2002 Mac OS X Server
All times are GMT -4. The time now is 10:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy