Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting script to ignore the user from list of users Post 302508072 by sumit30 on Friday 25th of March 2011 03:32:40 PM
Old 03-25-2011
Java script to ignore the user from list of users


I have a situation where I want to ignore few users from list of users and print rest of user in log file.

say, I want to ignore aaa, bbb, ccc, ddd .. ppp from list of 20 user (do not want to include)

What is the good command or any script?

Thanks in advance.
Test Your Knowledge in Computers #158
Difficulty: Easy
The migration of the ARPANET to TCP/IP was officially completed on January 1, 1983, when the new protocols were permanently activated.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

su - user... how to find out the list of users and their passwords..

hi, to do a su - user, we need to know what are the users... so in unix 1) which file to see the list of users, passwords? (2 Replies)
Discussion started by: yls177
2 Replies

2. AIX

Script allows user to kill other users: I'd like to know HOW...

Hello list, Have a problem that's highlighting gaps in my knowledge; can you assist? We have a script that's tacked onto our trading application which allows branch managers etc. to kill off the sessions of other users at their branch. A menu option in the application spawns a shell running... (8 Replies)
Discussion started by: alexop
8 Replies

3. UNIX for Dummies Questions & Answers

User Name and Password List/adding and removing users.

Hello everyone and let me start off by thanking anyone who can help with this. I work for a company that uses Unix as one of their servers. I'm not at all familar with Unix beyond logging after I restart the server:rolleyes: I'm looking for some command that will bring me up a list of current... (3 Replies)
Discussion started by: disgracedsaint
3 Replies

4. Shell Programming and Scripting

IF $USER is not in this list of users, then do this

I need to add to a BASH script if ${USER} is not in a list of users (smitha, brownd, adamsp) then do something... what is the best shortest way to accomplish an if statement with a list like this? Also the list of users should be in the script, not an external file. Thanks! (5 Replies)
Discussion started by: glev2005
5 Replies

5. Shell Programming and Scripting

Script to list users and their last login?

hi all, I'm trying to write a script to create a file with a list of all users, their gid, gecos field and their last login time e.g. fairly new to scripting, this is what I've got so far #!/bin/sh( userlist= cat /etc/passwd | awk -F: '{print $1," ",$4," ",$5}' for name in $userlist... (3 Replies)
Discussion started by: tanngo
3 Replies

6. Shell Programming and Scripting

Script to list primary group of users

Dear All I am facing a problem with my script. I have to found the primary group of users . So first I selected all the groups and users register from a specific user : ONE Then I am making a file with all groups attached to the user : ONE Then I am making a file with all... (8 Replies)
Discussion started by: Aswex
8 Replies

7. UNIX for Advanced & Expert Users

Need A Script To List All Failed Log In Users

I need to list all the failed log in users as part of audit report. How can I do so in Linux to find all the audit log records and then upload to a table for future reference. I am using oracle 10g on Linux. Hope I will get a quick response from the experts. Thanks in advance for the tips. (3 Replies)
Discussion started by: oraQ
3 Replies

8. Shell Programming and Scripting

help to create script for added date to list users

hi my friends im asking for the possibility to creat a script in ubuntu for added date to list users for doing this : - search in debug connected user of all connected users - if a new user is connect for the first time to my server the script record the date of the connection and added it... (1 Reply)
Discussion started by: amzioujda
1 Replies

9. Shell Programming and Scripting

Shell Script to ignore # and take corresponding user and group

Hi, I have a following file: role.IMPACT_USER.user=admin role.IMPACT_USER.user=dd12345 role.IMPACT_USER.user=ss76767 #role.IMPACT_USER.user=root #Description: Allow users to login in to Impact, start and stop service... (5 Replies)
Discussion started by: dbashyam
5 Replies

SplFileObject::fputcsv - Write a field array as a CSV line

public int SplFileObject::fputcsv (array $fields, [string $delimiter = ","], [string $enclosure = '"'], [string $escape = " DESCRIPTION
Writes the $fields array to the file as a CSV line. PARAMETERS
o $fields - An array of values. o $delimiter - The optional $delimiter parameter sets the field delimiter (one character only). o $enclosure - The optional $enclosure parameter sets the field enclosure (one character only). o $escape - The optional $escape parameter sets the escape character (one character only). RETURN VALUES
Returns the length of the written string or FALSE on failure. Returns FALSE, and does not write the CSV line to the file, if the $delimiter or $enclosure parameter is not a single character. ERRORS
/EXCEPTIONS An E_WARNING level error is issued if the $delimiter or $enclosure parameter is not a single character. CHANGELOG
+--------------+-------------------------------+ | Version | | | | | | | Description | | | | +--------------+-------------------------------+ |5.5.21, 5.6.5 | | | | | | | Added the $escape parameter. | | | | +--------------+-------------------------------+ EXAMPLES
Example #1 SplFileObject::fputcsv example <?php $list = array ( array('aaa', 'bbb', 'ccc', 'dddd'), array('123', '456', '789'), array('"aaa"', '"bbb"') ); $file = new SplFileObject('file.csv', 'w'); foreach ($list as $fields) { $file->fputcsv($fields); } ?> The above example will write the following to file.csv: aaa,bbb,ccc,dddd 123,456,789 """aaa""","""bbb""" SEE ALSO
fputcsv(3), SplFileObject::fgetcsv. PHP Documentation Group SPLFILEOBJECT.FPUTCSV(3)

Featured Tech Videos

All times are GMT -4. The time now is 11:59 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy