Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need to sort/change modify 2300 users ... Post 302222075 by Annihilannic on Wednesday 6th of August 2008 02:14:34 AM
Old 08-06-2008
Something like this perhaps?

Code:
awk -F: -v OFS=: 'length($1)>4 { $7="/bin/true" } 1' /etc/passwd > /tmp/newpasswd

Note that you may affect some system accounts doing this though, such as "nobody", "nuucp", "daemon", so you'll probably want to make it a bit more selective. I'll leave that part as an exercise for you!

Last edited by Annihilannic; 08-06-2008 at 03:15 AM.. Reason: I always forget to set OFS!!!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do I change users in a script???

Hi there, Does anyone know of a way I can become a different user in a script? I need to run a script as one user (not root), and change to another user half way through. It stops and asks me for the password, and I can't find a way to feed the password in through the script. Thanks (2 Replies)
Discussion started by: chorgan
2 Replies

2. AIX

Change users login name

Hi, I need to change some users login name in AIX. With solaris i donīt had problems, i have used "usermod". But in AIX the usermod command donīt have the same behavior. Can someone give me a tip on how to perform these changes? Thanks in advance. (9 Replies)
Discussion started by: spacewalker
9 Replies

3. Solaris

Qlogic 2300 and WWN display

hi all, I'm looking for a command to display the WWN of my 2 HBAs cards installed on my Solaris 8 server. I have installed HP securepath for multipathing but I can only see the controllers info of my SAN with spmgr display command. Any ideas ? Thanks a lot. Fabien (10 Replies)
Discussion started by: unclefab
10 Replies

4. Shell Programming and Scripting

Modify users password via script?

Ok, first off, I'm working on a Vmware ESX server, which I guess is loosely based off of Red Hat 9. But I'm brand new to it (today), so be nice. I'm trying to write a useradd script that will create some users, generate a password, and set their password to this newly generated password. ... (2 Replies)
Discussion started by: paqman
2 Replies

5. HP-UX

How to enforce users not to modify their command history.

As a system administrator. sometimes we see the users are trying some commands dangerous for the system health and remove them from their individual coomand history file. How it is possible to enforce that the normal usres will will not be able to modify the history. Thanks in advance. Partha (4 Replies)
Discussion started by: partha_bhunia
4 Replies

6. Shell Programming and Scripting

sort change

Hi i have a code where there is a sort command. but i am not able to understand what it does. (checked the man page but it is too confusing) cut -c 1-5,19-32,45-57 input.dtl| sort -c -T /temp/sorts -y +0.19 -0.32 +0.5 -0.19 +0.0 -0.5 can some one pls help (1 Reply)
Discussion started by: dnat
1 Replies

7. Shell Programming and Scripting

Change of group to different users

Need to change the chgrp for different uses d---rwx--t 3 root 764 4096 Mar 16 2007 algavi d---rwx--t 6 root 2857 4096 Jul 16 11:28 alharki d---rwx--t 5 root 2739 4096 Oct 14 2008 alpen d---rwx--t 5 root 546 4096 Mar 16 2007 alvarez d---rwx--t 3 root... (2 Replies)
Discussion started by: gsiva
2 Replies

8. Solaris

To restrict the users not to change the passwords for NIS users

Hi All, How to restrict the NIS users not to change their passwords in for NIS users?? and my NIS user is unable to login to at client location what could be the problem for this ? Any body can help me. Thanks in advance. (1 Reply)
Discussion started by: Sharath Kumar
1 Replies

9. Solaris

Can't change users passwd

Have an issue with a user or root changing the user's passwd. We run the passwd command and a complex passwd is entered a message is displayed, "passwd is based on a dictionary word." We do have a dictionary file and I know for a fact the complex passwd is not in the list. This happens on a... (3 Replies)
Discussion started by: solizkewl
3 Replies

10. Shell Programming and Scripting

How to Modify a file content in UNIX and sort for only required fields ?

I have the below contents in a file after making the below curl call curl ... | grep -E "state|Rno" | paste -sd',\n' | grep "Disconnected" > test "state" : "Disconnected",, "Rno" : "5554f1d2" "state" : "Disconnected",, "Rno" : "10587563" "state" : "Disconnected",, "Rno" :... (2 Replies)
Discussion started by: Vaibhav H
2 Replies
ln05jaof(8)						      System Manager's Manual						       ln05jaof(8)

NAME
ln05jaof - Filter for the Japanese DEClaser 2300 printer SYNOPSIS
/usr/lbin/ln05jaof [-c] [-h host] [-i indent] [-l length] [-L locale] [-n login] [-w width] [accounting_file] OPTIONS
Prints control characters. Specifies the host name of the job owner. This name can contain Japanese characters. Specifies the amount of indentation. The default value is no (no indentation). Specifies the page length in lines. The default value is 66. Specifies the printer codeset. This value must be a valid locale name. The default value is ja_JP.deckanji. Specifies the login name of the job owner. This name can contain Japanese characters. Specifies the page width in columns. The default value is 132. OPERANDS
Specifies the file to record accounting information. DESCRIPTION
The ln05jaof filter is used to filter text data for the Japanese DEClaser 2300 printer. The filter handles the device dependencies of the printer and performs accounting functions. At print job completion times, accounting records are written to the file specified by the af field in the /etc/printcap file. The ln05jaof filter can handle plain text files and files preprocessed by nroff. The filter translates nroff control sequences for under- lining, superscripting, and subscripting into the proper control sequences for the DEClaser 2300 printer. The ln05jaof filter can be the specified filter in both the of and the if fields in the /etc/printcap file. For a description of these fields, see printcap(4). The DEClaser 2300 printer can be configured to use the software on-demand loading (SoftODL) mechanism to print user-defined characters (UDCs). See i18n_printing(5) for a description of SoftODL. To enable SoftODL printing, set the ys field in /etc/printcap to 256. You can also set the default SoftODL database, style, and size by using the odldb and odlstyle options of the ya field. If you specify a value for the yt field, use fifo. For more information on these fields and associated options, refer to printcap(4). NOTES
The lpr command supports a number of options and associated arguments to enable localization features supported by various printers. The following can be used with the ln05jaof print filter: To specify the SoftODL database path To specify SoftODL font style and size For a complete description of the -A option and its arguments, refer to lpr(1). ERRORS
The lf field (default value is /dev/null) in the /etc/printcap file specifies the name of the error log. SEE ALSO
Commands: lpr(1), pr(1), lpd(8), pac(8) Files: printcap(4) Others: i18n_printing(5) ln05jaof(8)
All times are GMT -4. The time now is 10:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy