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
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
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
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
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
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
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
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
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
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
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
FD(4) BSD Kernel Interfaces Manual FD(4)
NAME
fd, stdin, stdout, stderr -- file descriptor files
DESCRIPTION
The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. If the file descriptor is
open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call:
fd = open("/dev/fd/0", mode);
and the call:
fd = fcntl(0, F_DUPFD, 0);
are equivalent.
Opening the files /dev/stdin, /dev/stdout and /dev/stderr is equivalent to the following calls:
fd = fcntl(STDIN_FILENO, F_DUPFD, 0);
fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
fd = fcntl(STDERR_FILENO, F_DUPFD, 0);
Flags to the open(2) call other than O_RDONLY, O_WRONLY and O_RDWR are ignored.
IMPLEMENTATION NOTES
By default, /dev/fd is provided by devfs(5), which provides nodes for the first three file descriptors. Some sites may require nodes for
additional file descriptors; these can be made available by mounting fdescfs(5) on /dev/fd.
FILES
/dev/fd/#
/dev/stdin
/dev/stdout
/dev/stderr
SEE ALSO
tty(4), devfs(5), fdescfs(5)
BSD
June 9, 1993 BSD