I need to count the number of files which have a search string, but counting the file only once
if search string is found.
eg: File1: Please note that there are 2 occurances of "aaa"
aaa
bbb
ccc
aaa
File2: Please note that there are 3 occurances of "aaa"
aaa
bbb
ccc... (1 Reply)
i am very new to UNIX
plz help me in this scenario
i have two text files as below
file1.txt
name=Rajakumar.
Discipline=Electronics and communication.
Designation=software Engineer.
file2.txt
name=Kannan.
Discipline=Mechanical.
Designation=CADD Design Engineer.
... (6 Replies)
Hi All,
Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example :
abc.txt
7000,john,2,1,0,1,6
7001,elen,2,2,0,1,7
7002,sami,2,3,0,1,6
7003,mike,1,4,0,2,1
8001,nike,1,5,0,1,8... (3 Replies)
i have one file, i am doing 'vi Filename' now i want to search for particular string and i want to know how many times that string occurs in whole file (5 Replies)
Hi
I have below script which is used to grep specific errors and if error string matches send an email alert.
Script is working fine , however , i wish to print next 10 lines of the string match to get the details of error in the email alert
Current code:-
#!/bin/bash
tail -Fn0 --retry... (2 Replies)
I have file which contains a huge amount of data. I need to search the pattern Message id. When that pattern is matched I need to get abcdeff0-1g6g-91g3-1z2z-2mm605m90000 to another file.
Kindly provide your input.
File is like below
Jan 11 04:05:10 linux100 |NOTICE... (2 Replies)
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
Hi there,
I am new to Unix and had below requirement to finish my task.
I have file1.dat which has data as shown below.
case1.txt
case2.txt
case3.txt
case4.txt
file1.dat has only file names
I have folder which has above files mentioned in file1.dat
./all_files
case1.txt... (6 Replies)
I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file.
Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies
LEARN ABOUT OSF1
advfs_clonefset
advfs_clonefset(3) Library Functions Manual advfs_clonefset(3)NAME
advfs_clonefset - Creates a read-only copy of an active fileset
SYNOPSIS
#include <sys/advfs_syscalls.h>
int advfs_clonefset(
char *domain,
char *fileset,
char *clonename );
LIBRARY
AdvFS Library (libadvfs)
PARAMETERS
Specifies the name of an existing AdvFS file domain. Specifies the name of original fileset. Specifies the name of the read-only clone
fileset of the original fileset.
DESCRIPTION
This function makes a read-only copy (clone) of an active fileset without taking the fileset off line.
When you create a clone fileset, it is a read-only snapshot of fileset data structures (metadata). That is, when you clone a fileset only
the structure of the original fileset is copied, not its data. As time goes by and as the files in the original fileset are modified, the
file system copies the original pages to the clone fileset. In this way, the clone fileset preserves the contents of files as they were in
the original fileset at the time you created the clone.
You can form a fileset backup strategy by managing clone filesets without ever needing to take the original filesets off line. For exam-
ple, you can determine when to unmount a clone, mount the clone on another mount point, and then use the vdump command to back it up.
You can create new versions of a clone fileset, but you can maintain only one clone per fileset at a time. You can remove an existing clone
fileset by using the advfs_rmfset function.
NOTES
This function has features identical to the utility described in clonefset(8).
RESTRICTIONS
This function only clones AdvFS filesets; it does not clone UFS file systems.
The program that calls this function must be running with root privilege.
A fileset must have a unique name of up to 31 characters. All whitespace characters (tab, new line, space, and so on) and the / # : * ?
characters are invalid for fileset names.
Do not create a clone fileset if the available disk space for the file domain is less than 5 percent of the total. When a file domain runs
out of disk space, the file system loses its ability to maintain the consistency of files within clone filesets. When the file system can
no longer maintain consistency, it displays warning messages similar to the following on the user's terminal and to the console: WARNING:
advfs cannot copy-on-write data to a clone file. WARNING: encountered the following error: ENO_MORE_BLKS (-1040) WARNING: do not continue
using the clone fileset. WARNING: original file set: name=mnt, id=2c06a73f.00027192.00000001.8001 WARNING: clone file set: name=clone,
id=2c06a73f.00027192.00000002.8002 WARNING: file id = 0000000a.8002
This message also appears in the /var/adm/syslog.dated/latest_boot_date/kern.log file.
RETURN VALUES
The function returns a value of 0 (zero) on successful completion. The function returns a value of -1 on failure and sets the value of
errno to the specific error.
ERRORS
The function sets errno to the specified errors for the following failure conditions: A valid AdvFS Advanced Utilities license is not
installed.
The calling program is not running with root privileges. The AdvFS lock for domain could not be acquired because one of the follow-
ing operations was already running on the domain: balance, defragment, rmfset, or rmvol. The fileset you want to clone already has
an existing clone. The name of the clone contains an invalid character or any of the parameters are NULL or set to . An I/O error
occurred on one of the disks in the file domain. The name of the clone is longer than 31 characters. The file domain specified by
the domain parameter does not exist.
The fileset specified by the fileset parameter does not exist in the file domain specified by the domain parameter. There is not
enough memory available for the operation. There is not enough available space in the file domain to create a clone fileset.
SEE ALSO
Commands: clonefset(8), mkfset(8), rmfset(8), showfsets(8)
Functions: advfs_rmfset(3)advfs_clonefset(3)