Sponsored Content
Operating Systems HP-UX pwage-hpux-T for Trusted HPUX servers Post 302507631 by methyl on Thursday 24th of March 2011 11:00:16 AM
Old 03-24-2011
Some points.

The normal secondary delimiter in the /etc/passwd comments field is a comma. Don't try a colon - it will corrupt the passwd file. The "usermod" command should stop you creating an invalid passwd file.

Quote:
cat /etc/passwd | grep $i |
This is a dodgy construct because it can give false matches in any field. In the simple case, consider usernames called "fred", "freda" and "alfred". One extreme case would be a username called "home".
A safer version in the style of your script:
Code:
grep \^${i}: /etc/passwd |

On many O/S the "for i in <open ended list>" construct will collapse when the command line becomes too long for the CLI.


Just for interest in non-trusted HP-UX you can get all the base information for this type of script from the command:
Code:
logins -xto


Last edited by methyl; 03-24-2011 at 12:16 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

HPUX 10.20 et HPUX 11

Is there any problems of binaries compatibility between HPUX 10.20 et 11 ? (2 Replies)
Discussion started by: Olivier
2 Replies

2. HP-UX

HPUX any help

:( i got couple of weeks ago a : HP Visualize workstation , model B100. everithing is ok in the box the only problem is that i 'am not familiar with this operational sys, and i try to uninstall and see if i can get on it windows net server 64 bit. or any other 64 bit operational sys that i'll... (1 Reply)
Discussion started by: newbird
1 Replies

3. UNIX for Dummies Questions & Answers

New to HPUX

Hi, I am a SAP Basis admin recentely been asked to administer a HPUX server. Could someone recommend some good study material to learn with the Sap prespective. -carry (1 Reply)
Discussion started by: carryclare
1 Replies

4. UNIX and Linux Applications

RPM For HPUX

Hi can any tell where we can get RPM files for HPUX OS RPM file can be of any application ,it should be succesfully installed in the machine Regards Harish Kumar :confused: (2 Replies)
Discussion started by: harishkumar
2 Replies

5. Shell Programming and Scripting

Need Script to Use CPUs on a HPUX server to simulate Workload Manager on HPUX.

I am running HPUX and using WLM (workload manager). I want to write a script to fork CPUs to basically take CPUs from other servers to show that the communication is working and CPU licensing is working. Basically, I want to build a script that will use up CPU on a server. Any ideas? (2 Replies)
Discussion started by: cpolikowsky
2 Replies

6. Shell Programming and Scripting

hpux vi

Hello. I cant figure out how can i move entire row up , so it pasted on the one above at the end , or to do that for one character. In notepads,word, or some other text editors we would do that with backspace button. Example. Content of my text file is this : I am trying to do that. And... (2 Replies)
Discussion started by: tonijel
2 Replies

7. UNIX and Linux Applications

Stop samba from querying trusted domain servers

Hi, We've got a samba server running in our DMZ. Our users drag & drop files on it for vendors. Everything was working perfectly until the powers that be decided to build a trust between a couple of internal domains. Samba is now querying each server in the trust. When a user browses... (5 Replies)
Discussion started by: mph
5 Replies

8. AIX

pwage-aix for IBM AIX servers

This is the password aging script for aix just completed. So far tested and still testing on one of our aix server running 5.3.0.0. So anyway as you can see it is very similar to pwage-hpux-T the only difference on aix /etc/passwd file looks in this format. Also for this script to work you need to... (0 Replies)
Discussion started by: sparcguy
0 Replies

9. Shell Programming and Scripting

Hpux

Hello All Why is hpux is not much spoken in the unix/Linux platform. what is the disadvantes in HPUX Thanks, VJ (1 Reply)
Discussion started by: Vijaykannan T
1 Replies

10. HP-UX

From a C++ application how to find if a hpux host is in standard mode or trusted mode

is there a way for my C++ application to find out which mode the hpux OS is running in? standard mode or trusted mode. (3 Replies)
Discussion started by: einsteinBrain
3 Replies
kconfig(5)							File Formats Manual							kconfig(5)

NAME
kconfig - introduction to kernel configuration commands DESCRIPTION
HP-UX contains a set of commands used to view and modify the configuration of the HP-UX kernel. The commands are: Operations on complete kernel configurations Operations on kernel modules Operations on kernel tunable parameters ("tunables") Retrieves pathnames of kernel files Searches and displays the kernel configuration log file Builds a kernel configuration from a system file KERNEL CONFIGURATIONS
The set of data that controls the behavior and content of the HP-UX kernel is called a kernel configuration. System administrators may save any number of kernel configurations, and may load any one of them at any time. A kernel configuration consists of module usage choices made using and tunable values chosen using By default, these commands affect the state of the currently running system. When these commands are given a option, they instead affect the saved kernel configuration named config. The currently running kernel configuration can be saved using A saved configuration can be loaded using This causes the state of the run- ning system to be changed to match the saved configuration. A saved configuration can be marked for use when the system is next booted, by using This makes no change to the state of the running system, but causes the specified saved configuration to be loaded when the system is rebooted. (See below.) Saved kernel configuration names must start with a letter; contain only letters, digits, and underscores (_); and be at most 32 characters in length. The names are case-distinct. Backup Configuration The system maintains a saved configuration called which can be used to recover from configuration errors. Depending on the selected backup behavior, the system can automatically save the currently running configuration to immediately before making any requested change to the configuration. The backup behavior is set using the option to the or commands. The recognized backup behaviors are: Always update the configuration before making a change. Update the configuration before making the current change. For subsequent changes, ask whether to update it. Do not update the configuration before making the current change. For subsequent changes, ask whether to update it. Never update configuration before changes. These behaviors can be abbreviated to one letter. For compatibility with previous releases, is accepted as an alias for and is accepted as an alias for These aliases will be removed in a future release. After each boot, the default backup behavior is to ask whether to update the configuration before each change. Changes made noninterac- tively assume a "no" response. Dynamic and Static Changes By default, the kernel configuration tools will apply configuration changes to the currently running system, causing an immediate change in their behavior. System administrators can override this default by specifying the option to changes made using the or commands. This option causes the change(s) to be held until the system is rebooted. HP recommends that this option be used only when the next reboot is expected to happen soon. If the reboot doesn't happen for months after the change, the change could come as an unwelcome surprise to an administrator who had forgotten the request. Some configuration changes cannot be applied without a reboot. These changes will be held until the system is rebooted even if the option is not specified. In these cases, a warning message will be printed. If multiple configuration changes are requested in a single invocation of one of the kernel configuration commands, and any one of those changes requires a reboot, all of the requested changes will be held until the system is rebooted. In particular, if a saved kernel con- figuration is loaded using and that configuration cannot be used without a reboot, the state of the running system is not changed and the specified kernel configuration is marked to be used at next boot. If a change to a configuration is being held until next boot, and a subsequent change to the same configuration setting is made with imme- diate effect, the immediate change will take precedence. The first change will not take effect at next boot. A warning will be printed in these situations. Changes that replace the entire currently running configuration, such as (import), (load), or (nextboot), cause any changes being held for next boot to be discarded. Changes that are made to the currently running system are retained when the system is rebooted. They remain in effect until changed, or until a saved kernel configuration is loaded. Boot Behavior When the system is booted, the administrator may specify the name of a saved kernel configuration on the boot command line (see hpux(1M) and hpux.efi(1M)). If so, that kernel configuration will be loaded during boot. If no kernel configuration is specified on the boot command line, the system will look for any kernel configuration that had been marked for use at next boot (via a or command). If any such configuration is found, that configuration will be loaded during boot. If no kernel configuration is specified on the boot command line, and none is marked for use at next boot, the system will boot using the same configuration that was in use before the reboot. If the configuration had any changes that were being held for reboot, either because they could not be applied without a reboot or because the option was used, those changes will be applied during the boot process. If the kernel configuration fails to boot properly, recovery can be attempted by booting the configuration and/or booting with the "fail- safe boot" flag on systems, on PA-RISC systems). See hpux(1M) and hpux.efi(1M) for details. SYSTEM FILES
Users of past releases of HP-UX may be used to keeping kernel configuration choices in a text file called Such a file is known as a "system file". A system file is automatically maintained for the currently running kernel configuration. This file can be found at System files are also automatically maintained for each saved kernel configuration. These files can be found at where config is the name of the saved configuration. Any time a kernel configuration (saved or current) is changed using one of the kernel configuration commands, the corre- sponding system file automatically gets rewritten to reflect the change. System files can also be generated on demand for any configura- tion using The format of a system file is described in system(4). It is possible to make configuration changes by modifying a system file in a text editor and then running This command will read the system file and modify the appropriate kernel configuration to match the contents of the system file. can also read a system file and modify a kernel configuration. It is retained for compatibility with previous releases of HP-UX. Note: Some configuration changes can be made without using one of the kernel configuration commands (for example, by calling the or sys- tem calls directly). In these cases, the system files are not automatically updated. Be sure to update them manually, or re-cre- ate them using before using them. Note: Avoid putting comments in a system file. System files get re-created every time a kernel configuration change is made, and com- ments are not preserved in this process. System files can be useful for propagating kernel configurations to other systems. To do so, use to export a configuration to a system file on a source machine. Move the file to one or more target machines and use to import the system file into a configuration on the tar- get. The target machines must have the same kernel filesets installed, or the import operation may fail. The flag can be used to ensure that the target machine has exactly the same versions of kernel filesets installed. If there are changes to the currently running kernel configuration that are being held for reboot, those changes are reflected in the sys- tem file LOG FILE
The kernel configuration commands maintain a log file that describes all kernel configuration changes. This log file is located at The command can be used to search and view the log file, or to make entries that don't correspond to configuration changes. When making a configuration change using any of the commands, you can specify a comment option. The commands will include the specified comment in the log file entry describing the change. Note that the comment usually must be quoted to avoid interpretation by the shell. Some configuration changes can be made without using the kernel configuration commands. No log file entries are made for such changes. The format of the log file may be changed without notice. Programs must use the command to retrieve entries from the file rather than attempting to parse the file format. DIAGNOSTICS
All error, warning, and note messages printed by the kernel configuration commands are numbered. For aesthetic reasons, the message num- bers are not usually displayed. To enable display of the message numbers, set the environment variable to 1. PARSING OUTPUT
Most of the kernel configuration commands produce tabular output describing the details of a configuration. Such output may be attractive for humans, but can be difficult for scripts and applications to parse. Also, the tabular output format can change at any time: for exam- ple, between different types of systems or between releases of HP-UX. For these reasons, each of the kernel configuration commands that produce such output accept a option, which changes the output format. The format is designed to be easy to parse, and is guaranteed not to change. HP will not support applications and scripts which parse the output of the kernel configuration commands unless they use the option. The option must be followed by a comma-separated list of field names. Each kernel configuration command supports a different set of field names; refer to the man page for the command for a list. The field names must appear in a single argument, so there should be no spaces anywhere in the list. For example, The kernel configuration command will produce output that consists of a series of lines describing one object, a blank line, a series of lines describing the next object, a blank line, and so on until all objects are described. Each line in the series consists of a field name, a single tab character (ASCII 9), and the value of that field for the object being described. The lines occur in the same order as requested. So the above command might produce this output: Some fields may occur multiple times within an object, or may not occur at all. This will be noted in the description of the field. For example, the command might produce this output: This shows that has no dependencies, but is dependent on two other modules. New fields may be added at any time, but they will not be included in the output unless specified in a option. Fields will not be removed. In rare cases, future developments may render a field meaningless. In these cases, the field name will still be accepted but the corre- sponding lines will be omitted from the output. SEE ALSO
hpux(1M), hpux.efi(1M), kclog(1M), kcmodule(1M), kconfig(1M), kcpath(1M), kctune(1M), mk_kernel(1M), modload(2), settune(2), system(4). available on kconfig(5)
All times are GMT -4. The time now is 01:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy