Sponsored Content
Full Discussion: actions based on file type
Top Forums Shell Programming and Scripting actions based on file type Post 10695 by doeboy on Monday 19th of November 2001 04:29:49 PM
Old 11-19-2001
I think your "if" logic needs to be cleaned up. You should probably use "elif" instead of the "if" after the first time you use it. Then you only need one fi at the end. Or, in this case, you may want to use "case" instead of "if".
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with simple scripting actions

Hi, I am a beginner in unix shell scripting. I wanted simple information like 1- How to know what are the number of command line options given for the script file? 2- How to check if a variable value is interger or string? 3- How to use awk to replace value of a variable For example I... (5 Replies)
Discussion started by: Nads
5 Replies

2. HP-UX

Auditing User's actions

Hi all I hope to find what i'm looking for in this forum as said in the topic i want to track user's actions on the system. i mean also the action of moving or removing files. I have an HP 9000 with HP UX 11i. the users log on the HP from a terminal window under WIndows XP Thx (3 Replies)
Discussion started by: Timberland
3 Replies

3. Programming

array type has incomplete element type

Dear colleagues, One of my friend have a problem with c code. While compiling a c program it displays a message like "array type has incomplete element type". Any body can provide a solution for it. Jaganadh.G (1 Reply)
Discussion started by: jaganadh
1 Replies

4. Shell Programming and Scripting

Perform a set of actions for a specific file type

Hello, I have a problem that I'm having quite a bit of trouble with. I am trying to create a script that performs a specific sequence of actions for a file of a specific type. This is an abbreviated version of my basic script: #!/bin/sh #coulombic calculations... (2 Replies)
Discussion started by: oehtus
2 Replies

5. Shell Programming and Scripting

[solved] File type error (not a regular file)

Hi friend, i have written script as below to check the file existance. but i got error path="/k/p1100/users/jewel/Output" FILENAME=`ls -lrt $path/*HT|tail -1|cut -d "/" -f 8` if ; then echo "$FILENAME is available " chmod 755 $path/$FILENAME /usr/bin/scp... (0 Replies)
Discussion started by: Jewel
0 Replies

6. Shell Programming and Scripting

Shell script to read file and check file type

Hi, I have a file with few values in it. I need script help to read file line by line and check: 1/if it's a file (with extension eg .java .css .jar etc ) or 2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
Discussion started by: iaav
6 Replies

7. Shell Programming and Scripting

Combining sed actions

Let's say I have an input file looking like: ID1 1 5 6 8 ID2 1 4 5 7 I'm trying to formulate a loop that can combine these actions: - If the line begins with a letter: replace the '\ n' after a field containing characters with a '\ t' (sed 's / \ n / \ t / g' ) - If the line... (2 Replies)
Discussion started by: dovah
2 Replies

8. UNIX for Dummies Questions & Answers

Count occurrence of string (based on type) in a column using awk

Hello, I have a table that looks like what is shown below: AA BB CC XY PQ RS AA BB CC XY RS I would like the total counts depending on the set they belong to: if search pattern is in {AA, BB, CC} --> count them as Type1 | wc -l (3 Replies)
Discussion started by: Gussifinknottle
3 Replies
TIME.CONF(5)							 Linux-PAM Manual						      TIME.CONF(5)

NAME
time.conf - configuration file for the pam_time module DESCRIPTION
The pam_time PAM module does not authenticate the user, but instead it restricts access to a system and or specific applications at various times of the day and on specific days or over various terminal lines. This module can be configured to deny access to (individual) users based on their name, the time of day, the day of week, the service they are applying for and their terminal from which they are making their request. For this module to function correctly there must be a correctly formatted /etc/security/time.conf file present. White spaces are ignored and lines maybe extended with '' (escaped newlines). Text following a '#' is ignored to the end of the line. The syntax of the lines is as follows: services;ttys;users;times In words, each rule occupies a line, terminated with a newline or the beginning of a comment; a '#'. It contains four fields separated with semicolons, ';'. The first field, the services field, is a logic list of PAM service names that the rule applies to. The second field, the tty field, is a logic list of terminal names that this rule applies to. The third field, the users field, is a logic list of users or a netgroup of users to whom this rule applies. For these items the simple wildcard '*' may be used only once. With netgroups no wildcards or logic operators are allowed. The times field is used to indicate the times at which this rule applies. The format here is a logic list of day/time-range entries. The days are specified by a sequence of two character entries, MoTuSa for example is Monday Tuesday and Saturday. Note that repeated days are unset MoMo = no day, and MoWk = all weekdays bar Monday. The two character combinations accepted are Mo Tu We Th Fr Sa Su Wk Wd Al, the last two being week-end days and all 7 days of the week respectively. As a final example, AlFr means all days except Friday. Each day/time-range can be prefixed with a '!' to indicate "anything but". The time-range part is two 24-hour times HHMM, separated by a hyphen, indicating the start and finish time (if the finish time is smaller than the start time it is deemed to apply on the following day). For a rule to be active, ALL of service+ttys+users must be satisfied by the applying process. Note, currently there is no daemon enforcing the end of a session. This needs to be remedied. Poorly formatted rules are logged as errors using syslog(3). EXAMPLES
These are some example lines which might be specified in /etc/security/time.conf. All users except for root are denied access to console-login at all times: login ; tty* & !ttyp* ; !root ; !Al0000-2400 Games (configured to use PAM) are only to be accessed out of working hours. This rule does not apply to the user waster: games ; * ; !waster ; Wd0000-2400 | Wk1800-0800 SEE ALSO
pam_time(8), pam.d(5), pam(8) AUTHOR
pam_time was written by Andrew G. Morgan <morgan@kernel.org>. Linux-PAM Manual 04/01/2010 TIME.CONF(5)
All times are GMT -4. The time now is 04:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy