Sponsored Content
Top Forums Shell Programming and Scripting Disk report generation problem Post 302581682 by kannan84 on Tuesday 13th of December 2011 10:06:24 PM
Old 12-13-2011
dude2cool,
Thanks for the reply

"comma" is already there in the variable $mj. Below is the debug output. Problem is grepping the major & minor number from the hdiskpower lists


HTML Code:
+ ls -l /dev/asm_disk1 /dev/asm_disk2 /dev/asm_disk3 /dev/asm_spfile
+ 1> /tmp/input10158174
+ cat /tmp/input10158174
+ read line
+ + echo crw-r--r-- 1 oracle dba 34, 3 Jun 21 20:06 /dev/asm_disk1
+ awk {print $5}
mj=34,
+ + awk {print $6}
+ echo crw-r--r-- 1 oracle dba 34, 3 Jun 21 20:06 /dev/asm_disk1
mi=3
+ + awk {print $10}
+ echo crw-r--r-- 1 oracle dba 34, 3 Jun 21 20:06 /dev/asm_disk1
asm_disk=/dev/asm_disk1
+ ls -l /dev/hdiskpower0 /dev/hdiskpower1 /dev/hdiskpower10 /dev/hdiskpower11 /dev/hdiskpower2 /dev/hdiskpower3 /dev/hdiskpower4 /dev/hdiskpower5 /dev/hdiskpower6 /dev/hdiskpower7 /dev/hdiskpower8 /dev/hdiskpower9
+ grep 34, 3
+ awk {print $10}
+ 1> /tmp/powerdiskinfo.rpt
Below is the error i am getting while grepping the major & minor number

HTML Code:
 
$ ls -l /dev/hdiskpower* |  grep 34, 11
grep: can't open 11
 
need to grep like below.

HTML Code:
ls -l /dev/hdiskpower* |  grep '34, 11'
 
brw-rw----    1 root     system       34, 11 May 16 2011  /dev/hdiskpower11
Please let me know how i can get it. Thanks again !

Regards
Kamal

---------- Post updated at 11:06 AM ---------- Previous update was at 11:03 AM ----------

ahamed101,
Thanks for your reply.

Below is the error i am getting

HTML Code:
awk 'NR==FNR{match($NF,".*/(.*)$",a);x[$5$6]=a[1];next} x[$5$6] {match($NF,".*/(.*)$",a);print x[$5$6],a[1]}' asm.txt power.txt
 syntax error The source line is 1.
 The error context is
                 >>> NR==FNR{match(NF),".*/(.*)$", <<< 
 awk: The statement cannot be correctly parsed.
 The source line is 1.
 syntax error The source line is 1.
 
Regards
Kamal
 

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
FDFORMAT(8)						     Linux Programmer's Manual						       FDFORMAT(8)

NAME
fdformat - Low-level formats a floppy disk SYNOPSIS
fdformat [ -n ] device DESCRIPTION
fdformat does a low level format on a floppy disk. device is usually one of the following (for floppy devices, the major = 2, and the minor is shown for informational purposes only): /dev/fd0d360 (minor = 4) /dev/fd0h1200 (minor = 8) /dev/fd0D360 (minor = 12) /dev/fd0H360 (minor = 12) /dev/fd0D720 (minor = 16) /dev/fd0H720 (minor = 16) /dev/fd0h360 (minor = 20) /dev/fd0h720 (minor = 24) /dev/fd0H1440 (minor = 28) /dev/fd1d360 (minor = 5) /dev/fd1h1200 (minor = 9) /dev/fd1D360 (minor = 13) /dev/fd1H360 (minor = 13) /dev/fd1D720 (minor = 17) /dev/fd1H720 (minor = 17) /dev/fd1h360 (minor = 21) /dev/fd1h720 (minor = 25) /dev/fd1H1440 (minor = 29) The generic floppy devices, /dev/fd0 and /dev/fd1, will fail to work with fdformat when a non-standard format is being used, or if the for- mat has not been autodetected earlier. In this case, use setfdprm(8) to load the disk parameters. OPTIONS
-n No verify. This option will disable the verification that is performed after the format. SEE ALSO
fd(4), setfdprm(8), mkfs(8), emkfs(8) AUTHOR
Werner Almesberger (almesber@nessie.cs.id.ethz.ch) Linux 0.99 1 February 1993 FDFORMAT(8)
All times are GMT -4. The time now is 05:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy