Sponsored Content
Operating Systems HP-UX Display SAM user list at the command line Post 303011966 by Don Cragun on Friday 26th of January 2018 03:57:29 PM
Old 01-26-2018
From your description, I am not at all sure that I understand what you are trying to do.

Are you trying to create a file that looks like the file you showed us in post #1 from unspecified input sources? If this is what you want, how are we supposed to guess where this data comes from?

Or, do you have a text file like the file you showed us in post #1 from which you want to extract a list of login names, a list of user IDs, or a list of real names? If this is what you want, which of those three lists do you want? And, what form should that list take? (All values on one line with a comma between values? All values on one line with a tab between them? Each value on a separate line? ...)

If you want a list of real names, you need to give us some way to clearly identify where that name starts and ends in your file. (In you sample data sometimes it is the 5th word, sometimes it is the 5th and 6th word, sometimes it is the complete line with the 1st 4 fields and the last field removed and then removing leading and trailing spaces on what is left, and sometimes it is the complete line with the 1st 4 fields and the last 2 fields removed and then removing the leading and trailing spaces. The starting character position and ending character position vary between lines, so we can't just use character positions.)

Once you have your file or list, what are you going to do with it?

You said you tried RTFM. Which pages in the manual did you try to read? Did you look at cut and tail? Did you look at awk?

Which HPUX release are you using?

Which shell are you using?
 

8 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Display Printers via command line

Is there an easy way to view all printers on a local machine via command line or a script? I'm looking for the equivalent of clicking on "START, CONTROL PANEL, PRINTERS AND FAXES" to view the devices. I then want to cat it to a file where I would use it later. Thanks (3 Replies)
Discussion started by: gseyforth
3 Replies

2. HP-UX

Where are SAM user templates stored?

Hey, new here, so be nice! I'm trying to write a little script to automate the user creation process on one of our boxes. But I would like to be able to use the templates that we have set up in SAM. Is the information in these templates stored in a file somewhere, that I can reference in my... (5 Replies)
Discussion started by: paqman
5 Replies

3. HP-UX

Adding user to a group without SAM

How can I add a user to a specific group without using SAM? I know I can user modprpw -G, but that will overwrite any groups the user is in with the ones I specify. I need to assume that I do not know what groups the user is already in, so I can't put them in the modprpw command. I just need... (2 Replies)
Discussion started by: paqman
2 Replies

4. HP-UX

How to reactivate user with command(no SAM)

How to reactivate any users (root or non root) by command(no SAM) HP-UX 11.11 (7 Replies)
Discussion started by: arm_naja
7 Replies

5. HP-UX

Getting command (command line) from SAM?

Hi I hope this is easy and sorry if I am using the wrong HP terms. I am looking for a way to glean the command line information from a process I run in SAM? In AIX I can just select any options I want for particular process and hit F6 and the command line is shown on the screen for use in... (3 Replies)
Discussion started by: KmJohnson
3 Replies

6. Homework & Coursework Questions

Display sorted list using sed command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a command line that will display a sorted list of logged in users. Just display the username and no other... (5 Replies)
Discussion started by: kofine05
5 Replies

7. UNIX for Advanced & Expert Users

Fc command does not display all commands history of a user

hi, i have an AIX6.1 machine and i modified a user's profile so that it creates history file for each ip address that connects with this user. the reason i did this is because more than 1 person connects with the same user so i want to keep track of command run by all of them. therefore, in the... (5 Replies)
Discussion started by: omonoiatis9
5 Replies

8. UNIX for Dummies Questions & Answers

To find and display the middle line in a file using single line command.

Hi all, How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies
cut(1)							      General Commands Manual							    cut(1)

NAME
cut - cut out (extract) selected fields of each line of a file SYNOPSIS
list [file]... list [file]... list char] [file]... DESCRIPTION
cuts out (extracts) columns from a table or fields from each line in a file; in data base parlance, it implements the projection of a rela- tion. Fields as specified by list can be fixed length (defined in terms of character or byte position in a line when using the or option), or the length can vary from line to line and be marked with a field delimiter character such as the tab character (when using the option). can be used as a filter; if no files are given, the standard input is used. When processing single-byte character sets, the and options are equivalent and produce identical results. When processing multi-byte char- acter sets, when the and options are used together, their combined behavior is very similar, but not identical to the option. Options Options are interpreted as follows: list A comma-separated list of integer byte option), character option), or field option) numbers, in increasing order, with optional to indicate ranges. For example: Positions 1, 4, and 7. Positions 1 through 3 and 8. Positions 1 through 5 and 10. Position 3 through last position. Cut based on a list of bytes. Each selected byte is output unless the option is also specified. Cut based on character positions specified by list extracts the first 72 characters of each line). Where list is a list of fields assumed to be separated in the file by a delimiter character (see for example, copies the first and seventh field only. Lines with no field delimiters will be passed through intact (useful for table sub- headings), unless is specified. The character following is the field delimiter option only). Default is tab. Space or other characters with special meaning to the shell must be quoted. Adjacent field delimiters delimit null fields. char may be an international code set character. Do not split characters. If the high end of a range within a list is not the last byte of a character, that character is not included in the output. However, if the low end of a range within a list is not the first byte of a character, the entire character is included in the output." Suppresses lines with no delimiter characters when using option. Unless is specified, lines with no delimiters appear in the output without alteration. Hints Use to extract text from a file based on text pattern recognition (using regular expressions). Use to merge files line-by-line in columnar format. To rearrange columns in a table in a different sequence, use and See grep(1) and paste(1) for more information. EXTERNAL INFLUENCES
Environment Variables determines the interpretation of text as single and/or multi-byte characters. If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari- able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support supports both single- and multi-byte character code sets. International code set characters may be specified in the char given to the option. recognizes the international code set characters according to the locale specified in the environment variable. EXAMPLES
Password file mapping of user ID to user names: Set environment variable to current login name: Convert file containing lines of arbitrary length into two files where contains the first 500 bytes (unless the 500th byte is within a multi-byte character), and contains the remainder of each line: DIAGNOSTICS
Line length must not exceed characters or fields, including the new-line character (see limits(5). Missing or option or incorrectly specified list. No error occurs if a line has fewer fields than the list calls for. list is empty. WARNINGS
does not expand tabs. Pipe text through expand(1) if tab expansion is required. Backspace characters are treated the same as any other character. To eliminate backspace characters before processing by use the or com- mand (see fold(1) and col(1)). AUTHOR
was developed by OSF and HP. SEE ALSO
grep(1), paste(1). STANDARDS CONFORMANCE
cut(1)
All times are GMT -4. The time now is 05:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy