Sponsored Content
Top Forums Shell Programming and Scripting Disk report generation problem Post 302581668 by kannan84 on Tuesday 13th of December 2011 08:37:18 PM
Old 12-13-2011
Disk report generation problem

Hello everyone,

I have a list of inputs as below. My logic is to get the particular powerdisk which matches for ASM disk which means take the major & minor number of each asm disk and matches with powerdisk info then get the particular powerdisk

HTML Code:
$ ls -l /dev/asm_* ---> ASM disk info
crw-r--r-- 1 oracle dba 34, 3 Jun 21 20:06 /dev/asm_disk1
crw-r--r-- 1 oracle dba 34, 4 Jun 21 20:06 /dev/asm_disk2
crw-r--r-- 1 oracle dba 34, 5 Jun 21 20:06 /dev/asm_disk3
crw-r--r-- 1 oracle dba 34, 11 Jun 21 20:05 /dev/asm_spfile
HTML Code:
$ ls -l /dev/hdiskpower* --> Powerdisk info
brw-rw---- 1 root system 34, 3 Apr 7 2011 /dev/hdiskpower3
brw-rw---- 1 root system 34, 4 Apr 7 2011 /dev/hdiskpower4
brw-rw---- 1 root system 34, 5 Apr 7 2011 /dev/hdiskpower5
brw-rw---- 1 root system 34, 6 May 16 2011 /dev/hdiskpower6
brw-rw---- 1 root system 34, 7 May 16 2011 /dev/hdiskpower7
brw-rw---- 1 root system 34, 8 May 16 2011 /dev/hdiskpower8
brw-rw---- 1 root system 34, 9 May 16 2011 /dev/hdiskpower9
Below is the code i am using

Code:
============

HTML Code:
ls -l /dev/asm_* > /tmp/input$$
cat /tmp/input$$ | while read line
do
mj=`echo $line | awk '{print $5}'`
mi=`echo $line | awk '{print $6}'`
asm_disk=`echo $line | awk '{print $10}'`
ls -l /dev/hdiskpower* | grep '"'$mj $mi'"' | awk '{print $10}' > /tmp/powerdiskinfo.rpt
done
=============
above code is not working while matching with major and minor number with the hdiskpower disks. Please advice how i can achive it . I need the output as below

HTML Code:
ex:
==
asm_disk1     hdiskpower1
asm_disk2     hdiskpower3
asm_disk3     hdiskpower5
Kindly provide your suggetions and ideas. Thanks !

Regards
Kannan
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Oracle Report generation

Hi, I am beginner in shell programming.In a shell script i found a call to a script 'runrep25m',which i think is to generate oracle reports?Could anyone help me by providing some details about its usage With Thanks & Regards Dileep (7 Replies)
Discussion started by: DILEEP410
7 Replies

2. Shell Programming and Scripting

awk- report generation from input file

I have input file with below content: Person: Name: Firstname1 lastname1 Address: 111, Straat City : Hilversum Person: Name : Fistname2 lastname2 Address: 222, street Cit: Bussum Person: Name : Firstname2 lastname3 Address: 333, station straat City: Amsterdam I need... (6 Replies)
Discussion started by: McLan
6 Replies

3. UNIX for Dummies Questions & Answers

report generation

Hello, I got a requirement in writing a sheel script in unix, please help me out the requirement is there are two folders Folder1 and Folder2 and there are same files in the different folders. like file1,file2 in folder1 and file1 and file2 in folder2. I would like to compare all the... (2 Replies)
Discussion started by: gmahesh2k
2 Replies

4. Shell Programming and Scripting

Report generation

Hello, I got a requirement in writing a KSH script in unix, please help me out the requirement is there are two folders Folder1 and Folder2 and there are same files in the different folders. like file1,file2 in folder1 and file1 and file2 in folder2. I would like to compare all the similar... (3 Replies)
Discussion started by: gmahesh2k
3 Replies

5. Shell Programming and Scripting

Report Generation with Grep

All, I am pretty new to Unix Environment. I am not sure if my requirement can be accomplished in Unix. I did try searching this forum and others but could not get an answer. Requirement is explained below: I have a set of files in a folder. file1_unload file2_unload file3_unload... (7 Replies)
Discussion started by: bharath.gct
7 Replies

6. Shell Programming and Scripting

File Report Generation

hi all i need to generate a report file that contains the following details of files present in a directory. 1. File name 2.Complete path for each files and directory 3.File size 4.Days older example i have a directory testing that contains sub-directories and some files. i need to make a... (5 Replies)
Discussion started by: yashwantkumar
5 Replies

7. Shell Programming and Scripting

Report generation based on certain conditions

Hi I recently joined a project where I have been asked to generate a report using shell script accessing UNIX box. I have no idea on how to do it as I am a beginner and learning shell scripts. Suppose I have a XML: Code: ... (3 Replies)
Discussion started by: vat1kor
3 Replies

8. Shell Programming and Scripting

Report generation using perl script

Hi, I have a perl script to read the log file and create a report from it. I have the script file and log file in a different directories. Now i have pipe the log file data to the perl script to create the report (HMTL file). I am using the below command this isn't working tail -f... (4 Replies)
Discussion started by: vel4ever
4 Replies

9. UNIX for Beginners Questions & Answers

UNIX cluster disk usage report generation for yesterday & today and email

HI Team, I am trying to create a shell script to generate a yesterday and today report to compare and email in daily basis. can you please help me on the same. #!/bin/bash #Author: ******************* #Description: This script will return the following set of system information: ... (2 Replies)
Discussion started by: Mi4304
2 Replies

10. UNIX for Beginners Questions & Answers

Report generation using script

Hi all I have a unix script that generates a report with the following information: uptime, mounted file systems, disk usage (> 90% --> critical, <75%-90%> --> warning, < 75% healthy), Mem usage, CPU usage and load average. But I would like to create one single report containing all this... (5 Replies)
Discussion started by: fretagi
5 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWgawk | +--------------------+-----------------+ |Interface Stability | Volatile | +--------------------+-----------------+ NOTES
Source for gawk is available on http://opensolaris.org. Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 04:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy