10-17-2012
Help need to subtract the data from 2 columns
space_used.lst
|
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata01 505G 318G 175G 65% /dborafiles/nethealth21/PV/oradata01 |
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata02 505G 433G 67G 87% /dborafiles/nethealth21/PV/oradata02 |
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata03 507G 422G 79G 85% /dborafiles/nethealth21/PV/oradata03 |
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata04 507G 312G 182G 64% /dborafiles/nethealth21/PV/oradata04 |
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata05 507G 356G 141G 72% /dborafiles/nethealth21/PV/oradata05 |
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata06 507G 220G 269G 46% /dborafiles/nethealth21/PV/oradata06 |
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata07 101G 46G 52G 47% /dborafiles/nethealth21/PV/oradata07 |
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata08 450G 255G 183G 59% /dborafiles/nethealth21/PV/oradata08 |
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata09 456G 321G 126G 72% /dborafiles/nethealth21/PV/oradata09 |
/dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata10 300G 231G 65G 78% /dborafiles/nethealth21/PV/oradata10 |
Actual_used.lst
|
317G /dborafiles/nethealth21/PV/oradata01 |
433G /dborafiles/nethealth21/PV/oradata02 |
422G /dborafiles/nethealth21/PV/oradata03 |
312G /dborafiles/nethealth21/PV/oradata04 |
356G /dborafiles/nethealth21/PV/oradata05 |
220G /dborafiles/nethealth21/PV/oradata06 |
45G /dborafiles/nethealth21/PV/oradata07 |
254G /dborafiles/nethealth21/PV/oradata08 |
321G /dborafiles/nethealth21/PV/oradata09 |
230G /dborafiles/nethealth21/PV/oradata10 |
My requirement is to subtract values as below.
(column 3 displayed in space_used.lst) - (column 1 displayed in actual_used.lst)
And I expect the output as below. Can you pls help me to write a shell script?
|
Desired output: |
=============== |
1G /dborafiles/nethealth21/PV/oradata01 |
0G /dborafiles/nethealth21/PV/oradata02 |
0G /dborafiles/nethealth21/PV/oradata03 |
0G /dborafiles/nethealth21/PV/oradata04 |
0G /dborafiles/nethealth21/PV/oradata05 |
0G /dborafiles/nethealth21/PV/oradata06 |
0G /dborafiles/nethealth21/PV/oradata07 |
1G /dborafiles/nethealth21/PV/oradata08 |
0G /dborafiles/nethealth21/PV/oradata09 |
1G /dborafiles/nethealth21/PV/oradata10 |
|
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to access of two different file.
cat in_file | awk -F: '{
in_total += $1 * 86400 + $2 * 3600 + $3 * 60 + $4
} END {printf "%d\n",in_total} '
cat out_file | awk -F: '{
out_total += $1 * 86400 + $2 * 3600 + $3 * 60 + $4
} END {printf "%d\n",out_total} '
I want to sub... (2 Replies)
Discussion started by: krishna_sicsr
2 Replies
2. Shell Programming and Scripting
Hope somebody is happy.
NR==1 {
num_columns=split( $0, menuend );
next;
}
{
split( $0, substrend );
for ( i=1; i<=NF; i++ ) {
minuend -= substrend;
}
}
END {
print "Result:";
for ( i=1; i<=num_columns; i++ ) {
printf(... (3 Replies)
Discussion started by: awkward
3 Replies
3. Shell Programming and Scripting
Hi,
I need some help figuring this out, I think it can be done using awk but I don't know how.
So, I want to take two input files, subtract some columns with each other and then output to a new results file.
InFile1.txt
AAA 100 200 BBB
CCC 300 400 DDD
InFile2.txt
AAA 50 60 BBB
CCC 70... (7 Replies)
Discussion started by: MrTrigger
7 Replies
4. Shell Programming and Scripting
Hi,
I want to subtract a number from all columns except the first column. I have a number of files each having different columns around 60/70. How to do that in awk or any other command?
Thanks
Input
Col 1 Col 2 Col3 - - - - Col55
1 .0123 .098 - - - 0.6728
2 - -... (3 Replies)
Discussion started by: Surabhi_so_mh
3 Replies
5. Shell Programming and Scripting
Hi,
I have one .csv file. I have 2 date columns present in file, column 2 and column 3.
I need to calculate how many days exist between 2 dates.
I am trying to subtract date column 2 from date column 3.
Eg: my file look likes
s.no, Start_date,End_Date
1, 7/29/2012,10/27/2012
2,... (9 Replies)
Discussion started by: Dimple
9 Replies
6. Shell Programming and Scripting
Hi All,
I have a file with thousands of lines in the following format, where
Field1=First 8 characters
Field2-9-16 characters
Field3=17-26 characters
I need to add Field 1 and Field2 and subtract the result from Field 3.
Field3=Field3 - (Field1 + Field2)
0012.00 0010.00 0001576.53... (4 Replies)
Discussion started by: nua7
4 Replies
7. Shell Programming and Scripting
I have a file which has all integer numbers like this. This file is sort of very large, and I am only showing the first few contents. This representation can be regarded as a matrix of integer numbers.
14998
16 0 11680 3165 15343 8553 9925 3875 820 6430 14226 13261 11355 15428 9140 16184 7934... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies
8. UNIX for Dummies Questions & Answers
---------- Post updated at 01:58 PM ---------- Previous update was at 01:48 PM ----------
For some reason my question is not getting printed. Here are the details:
Greetings.
I would like to add/subtact an integer to/from two columns of integers. I feel like this should be easy using awk... (3 Replies)
Discussion started by: Twinklefingers
3 Replies
9. Shell Programming and Scripting
Hi below is a file
Date Category Time Attempts Success
2/17/2014 PayFlow ATB 0.999988 4039104 4039057
2/18/2014 PayFlow ATB 0.999912 4620964 4620558
2/19/2014 PayFlow ATB 0.999991 4380836 4380796
2/20/2014 PayFlow ATB 0.999988 5031047 5030985
2/21/2014 ... (5 Replies)
Discussion started by: villain41
5 Replies
10. Shell Programming and Scripting
Hi,
I have 2 files in below formats
File1_Stored.txt
ABC:100, 83
ABC:84, 53
ABC:14, 1222And
File2_Stored.txt
ABC:100 , 83
ABC:84 , 1553
ABC:524 , 2626I am trying to get the 3rd file in below format. So, whenever difference is 0 it shouldn't appear but if the difference is not 0 then... (2 Replies)
Discussion started by: Abhayman
2 Replies
volfs(7FS) File Systems volfs(7FS)
NAME
volfs - Volume Management file system
DESCRIPTION
volfs is the Volume Management file system rooted at root_dir. The default location for root-dir is /vol, but this can be overridden using
the -d option of vold (see vold(1M)). This file system is maintained by the Volume Management daemon, vold, and will be considered to be
/vol for this description.
Media can be accessed in a logical manner (no association with a particular piece of hardware), or a physical manner (associated with a
particular piece of hardware).
Logical names for media are referred to through /vol/dsk and /vol/rdsk. /vol/dsk provides block access to random access devices. /vol/rdsk
provides character access to random access devices.
The /vol/rdsk and /vol/dsk directories are mirrors of one another. Any change to one is reflected in the other immediately. The dev_t for a
volume will be the same for both the block and character device.
The default permissions for /vol are mode=0555, owner=root, group=sys. The default permissions for /vol/dsk and /vol/rdsk are mode=01777,
owner=root, group=sys.
Physical references to media are obtained through /vol/dev. This hierarchy reflects the structure of the /dev name space. The default per-
missions for all directories in the /vol/dev hierarchy are mode=0555, owner=root, group=sys.
mkdir(2), rmdir(2), unlink(2) (rm), symlink(2) (ln -s), link(2) (ln), and rename(2) (mv) are supported, subject to normal file and direc-
tory permissions.
The following system calls are not supported in the /vol filesystem: creat(2), only when creating a file, and mknod(2).
If the media does not contain file systems that can be automatically mounted by rmmount(1M), users can gain access to the media through the
following /vol locations:
+-----------------------------------+------------------------------------+
| Location | State of Media |
+-----------------------------------+------------------------------------+
|/vol/dev/diskette0/unnamed_floppy | formatted unnamed floppy-block |
| | device access |
+-----------------------------------+------------------------------------+
|/vol/dev/rdiskette0/unnamed_floppy | formatted unnamed floppy-raw |
| | device access |
+-----------------------------------+------------------------------------+
|/vol/dev/diskette0/unlabeled | unlabeled floppy-block device |
| | access |
+-----------------------------------+------------------------------------+
|/vol/dev/rdiskette0/unlabeled | unlabeled floppy-raw device access |
+-----------------------------------+------------------------------------+
|/vol/dev/dsk/c0t6/unnamed_cdrom | CD-ROM-block device access |
+-----------------------------------+------------------------------------+
|/vol/dev/rdsk/c0t6/unnamed_cdrom | CD-ROM-raw device access |
+-----------------------------------+------------------------------------+
For more information on the location of CD-ROM and floppy media, see System Administration Guide: Basic Administration or rmmount(1M).
Partitions
Some media support the concept of a partition. If the label identifies partitions on the media, the name of the media becomes a directory
with partitions under it. Only valid partitions are represented. Partitions cannot be moved out of a directory.
For example, if disk volume 'foo' has three valid partitions, 0, 2, and 5, then:
/vol/dsk/foo/s0
/vol/dsk/foo/s2
/vol/dsk/foo/s5
for block access and
/vol/rdsk/foo/s0
/vol/rdsk/foo/s2
/vol/rdsk/foo/s5
for character access.
If a volume is relabeled to reflect different partitions, the name space changes to reflect the new partition layout.
A format program can check to see if there are others with the volume open and not allow the format to occur if it is. Volume Management,
however, does not explicitly prevent the rewriting of a label while others have the volume open. If a partition of a volume is open, and
the volume is relabeled to remove that partition, it will appear exactly as if the volume were missing. A notify event will be generated
and the user may cancel the operation with volcancel(1), if desired.
SEE ALSO
volcancel(1), volcheck(1), volmissing(1) rmmount(1M), vold(1M), rmmount.conf(4), vold.conf(4)
System Administration Guide: Basic Administration
SunOS 5.10 8 Feb 1995 volfs(7FS)