So, if you are certain that the MOUNTPOINT=" will always be the last field, you could:-
List the filesystems
For each filesystem, get the data from file 1
For each filesystem, get the data from file 2
Display the output required or nothing if no match
It's a bit clunky, but it's for a very small volume of data. Something like this might do:-
Code:
#!/bin/bash
f1_file=/tmp/d21
f2_file=/tmp/f2 # Or whatever
while read filesystem
do
filesystem_list="${filesystem_list} ${filesystem}"
done < <(cut -f14 -d"\"" ${f1_file})
for filesystem in $filesystem_list
do
f1_line=$(grep "MOUNTPOINT=\"${filesystems}\" "${f1_file}"
f2_line=$(grep -E "${filesystems}$" "${f2_file}"
if [ ! -z "${f2_line} ]
then
# Work on the two data lines you have to extract the data you want
else
echo "You have incomplete data for filesystem ${filesystem}"
fi
done
Like I say, pretty clunky, but maybe that's all you need.
hey guys, I have two files both with two columns, I have already created an
awk code to ignore certain lines (e.g lines that start with 963) as they wou
ld begin with a certain string, however, the rest I have added together and
calculated the average.
At the moment the code also displays... (3 Replies)
Hi guys,
I need some help to come out with a solution . I have seven such files but I am showing only three for convenience.
filea
a5 20
a8 16
fileb
a3 42
a7 14
filec
a5 23
a3 07
The output file shoud contain the data in table form showing first field of... (7 Replies)
Hello,
I am strugling from quite a some time to compare flat files with over 1 million records could anyone please help me.
I want to compare two pipe delimited flat files, file1 with file2 and output the unmatched rows from file2 in file3
Sample File1:
... (9 Replies)
You have two files to compare by searching keyword from one file into another file
File A
23 >pp_ANSWER
24 >aa hello
25 >jau head wear
66 >jss oops
872 >aqq olps ploww oww sss
722 >GG_KILLER
..... large files
File B
Beta done
KILLER
John Mayor
calix meyers
... (5 Replies)
All,
PLease can you help me with a shell script which can compare two xml files and print the difference to a output file.
I have attached one such file for you reference.
<Group>
<Member ID=":Year_Quad:41501" childCount="4" fullPath="PEPSICO Year-Quad-Wk : FOLDER.52 Weeks Ending Dec... (2 Replies)
File 1 has 16 columns so does File 2
I want to remove all records from File 2 that column 1 and column 16 match between file 1 and file 2
delimter of files is ~ (10 Replies)
Hi,
I have multiple files that each contain one column of strings:
File1:
123abc
456def
789ghi
File2:
123abc
456def
891jkl
File3:
234mno
123abc
456def
In total I have 25 of these type of file. (5 Replies)
Discussion started by: owwow14
5 Replies
LEARN ABOUT DEBIAN
mounted
mounted(7) Miscellaneous Information Manual mounted(7)NAME
mounted - event signalling that a filesystem has been mounted
SYNOPSIS
mounted DEVICE=DEVICE MOUNTPOINT=MOUNTPOINT TYPE=TYPE OPTIONS=OPTIONS [ENV]...
DESCRIPTION
The mounted event is generated by the mountall(8) daemon after it has mounted a filesystem. mountall(8) will wait for all services started
by this event to be running, all tasks started by this event to have finished and all jobs stopped by this event to be stopped before emit-
ting any other events related to this filesystem or continuing with other filesystems depending on this one.
The DEVICE, MOUNTPOINT, TYPE and OPTIONS environment variables contain the values of the fstab(5) fields for this mountpoint.
EXAMPLE
A tool that should be run after mounting the /tmp filesystem might use:
start on mounted MOUNTPOINT=/tmp
task
SEE ALSO mounting(7)virtual-filesystems(7)local-filesystems(7)remote-filesystems(7)all-swaps(7)filesystem(7)mountall 2009-12-21 mounted(7)