Sponsored Content
Top Forums Shell Programming and Scripting help with awk to create report Post 59940 by zazzybob on Wednesday 5th of January 2005 07:13:46 AM
Old 01-05-2005
I'll throw my script into the pot too...

Code:
#!/bin/ksh

printf "%-9s%-20s%-25s%-10s\n" "User" "Group" "Full Name" "Home"
printf "%-9s%-20s%-25s%-10s\n" "----" "-----" "---------" "----"

while read line
do
  gid=`echo $line | awk -F':' '{print $4}'`
  group=`grep ":$gid:" /etc/group | cut -d':' -f 1`
  echo "$line" | awk -vg=$group -vFS=':' '{ printf( "%-9s%-20s%-25s%-10s\n", $1, g, $5, $6 ) }'
done < /etc/passwd

echo "END OF REPORT"

Cheers
ZB
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

create a report using shell

hi suppose I want to create a report where it will shows the machine name, the date & time when the report is produced. can anyone please help me to write such shell script? requesting all. Thanks (10 Replies)
Discussion started by: moco
10 Replies

2. Shell Programming and Scripting

using todays date to create a report using grep

What i'm trying to do is to use grep to search through a few files for a selected daemon and only report on today's date. I think I got it sorted apart from in the txt file the date has 2 gaps between the month and the day, and the way I have the date format only puts in one gap any help to get... (3 Replies)
Discussion started by: MBN
3 Replies

3. Shell Programming and Scripting

How to format or create a matrix report from file

Dear Unix champs, I have a input file as attached, i would like to create an report from the file as below FileType | EQUENS0001 | EQUENS0002 | EQUENS1100 | EQUENS0003 --------+-------------------------------------------------------- Msg No |... (3 Replies)
Discussion started by: manas_ranjan
3 Replies

4. Shell Programming and Scripting

Bash: create a report with grep output?

Greetings. I need to generate a simple report via Bash (Korn?) with this raw data Test_Version=V2.5.2 Test_Version=V2.6.3 Test_Version=V2.4.7 Test_Version=V2.5.2 Test_Version=V2.5.2 Test_Version=V2.5.1 Test_Version=V2.5.0 Test_Version=V2.3.9 ... (3 Replies)
Discussion started by: alan
3 Replies

5. Shell Programming and Scripting

Need to develop a script to create a report reading multiple server logs

I am currently trying to develop a script to connect to mulltiple servers, reading specifc data from log files on the servers and append the data from each file into a single tab delimited row. So, at the end I am planning to have a report with all the extracted data with each row per server. I am... (5 Replies)
Discussion started by: scriptingnewbie
5 Replies

6. Shell Programming and Scripting

Create a report for client with a text data file

Hi, I am an amateur bash scriptwriter and I need to write a script which creates a report in a formatted, easy to read table-like that is displayed to standard output. The script has to export the followings: Process ID,User Name, Command Name,Priority..... Now I have a file that I can see all... (3 Replies)
Discussion started by: bashily
3 Replies

7. Shell Programming and Scripting

Script to create DHCP report

Hi, In our company, we have been asked to design a script to automate the report of all IP's which are free/used from all the pools in DHCP at any given Amount of time. We have prepare the following script. The problem is when we run the script manually from the command prompt, it brings proper... (1 Reply)
Discussion started by: Crazy_Nix
1 Replies

8. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

9. Shell Programming and Scripting

Need to create a report using paste or with awk

Input file will be Name: serve1 has disk :Yes dev (8): Name: serve2 has disk :No dev (8): Name: serve3 has disk :No Name: serve4 has disk :Yes dev (8): Need output like that. I was using pate -d, - - - . But that need all the line in same format in this some server it has... (4 Replies)
Discussion started by: ranjancom2000
4 Replies
OCF_HEARTBEAT_SLAPD(7)						OCF resource agents					    OCF_HEARTBEAT_SLAPD(7)

NAME
ocf_heartbeat_slapd - Manages a Stand-alone LDAP Daemon (slapd) instance SYNOPSIS
slapd [start | stop | monitor | meta-data | validate-all] DESCRIPTION
Resource script for Stand-alone LDAP Daemon (slapd). It manages a slapd instance as an OCF resource. SUPPORTED PARAMETERS
slapd Full path to the slapd binary. For example, "/usr/sbin/slapd". (optional, string, default "/usr/sbin/slapd") ldapsearch Full path to the ldapsearch binary. For example, "/usr/bin/ldapsearch". (optional, string, default "ldapsearch") config Full path to a slapd configuration directory or a slapd configuration file. For example, "/etc/ldap/slapd.d" or "/etc/ldap/slapd.conf". (unique, optional, string, no default) pidfile File to read the PID from; read from olcPidFile/pidfile in config if not set. (optional, string, no default) user User name or id slapd will run with. The group id is also changed to this user's gid, unless the group parameter is used to override. (optional, string, no default) group Group name or id slapd will run with. (optional, string, no default) services LDAP (and other scheme) URLs slapd will serve. For example, "ldap://127.0.0.1:389 ldaps:/// ldapi:///" (unique, optional, string, default "ldap:///") watch_suffix Suffix (database backend) that will be monitored for availability. Multiple suffixes can be specified by providing a space seperated list. By providing one or more suffixes here, the ignore_suffix parameter is discarded. All suffixes will be monitored if left blank. (optional, string, no default) ignore_suffix Suffix (database backend) that will not be monitored for availability. Multiple suffixes can be specified by providing a space seperated list. No suffix will be excluded if left blank. (optional, string, no default) bind_dn Distinguished Name used to bind to the LDAP directory for testing. Leave blank to bind to the LDAP directory anonymously. (optional, string, no default) password Password used to bind to the LDAP directory for testing. (optional, string, no default) parameters slapd may be called with additional parameters. Specify any of them here. (optional, string, no default) stop_escalate Number of seconds to wait for shutdown (using SIGTERM) before resorting to SIGKILL (optional, integer, default 15) SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 20s. stop Stops the resource. Suggested minimum timeout: 20s. monitor Performs a detailed status check. Suggested minimum timeout: 20s. Suggested interval: 60s. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 20s. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s. EXAMPLE
The following is an example configuration for a slapd resource using the crm(8) shell: primitive p_slapd ocf:heartbeat:slapd op monitor depth="0" timeout="20s" interval="60s" SEE ALSO
http://www.linux-ha.org/wiki/slapd_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents UNKNOWN 06/09/2014 OCF_HEARTBEAT_SLAPD(7)
All times are GMT -4. The time now is 03:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy