Visit Our UNIX and Linux User Community

How to check number of group of file.?

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to check number of group of file.?
# 1  
Old 10-07-2013
How to check number of group of file.?

Hi Gurus,

I need check existing number of file based on the list in file list.
for example:
in my file list. I have below:

abc, file1.txt
abc, file2.txt
abc, file3.txt
abc, file4.txt
cde, filea1.txt
cde, filea2.txt
cde, filea3.txt

in my current file direcotry, I have file:

there 4 files for first group abc, after remove date partition (20130502) the files are completed, so, I need log into DB through sqlplus run query select count(*) from tab where group = 'abc', if count(*) > 0 then do nothing, if count(*) = 0 then call another script.
for group cde there is one file missing, I need send warning.

anybody can help me this?

Thanks in advance.

Last edited by ken6503; 10-07-2013 at 09:26 PM..

Previous Thread | Next Thread
Test Your Knowledge in Computers #684
Difficulty: Medium
According to both NetMarketShare and WikiMedia, Safari claimed a mobile market share of over 40% in 2019.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to check when a group was removed for an id?

An id was a part of a particular user group. All of a sudden that id was removed from that group, because of which many things failed. How do I find out when/who modified the id settings? (2 Replies)
Discussion started by: ggayathri
2 Replies

2. Shell Programming and Scripting

To check the missing file based on sequence number.

Hi All, I have a requirement that i need to list only the missing sequences with a unix script. For Example: Input: FILE_001.txt FILE_002.txt FILE_005.txt FILE_006.txt FILE_008.txt FILE_009.txt FILE_010.txt FILE_014.txt Output: FILE_003.txt FILE_004.txt FILE_007.txt FILE_011.txt... (5 Replies)
Discussion started by: Arun1992
5 Replies

3. Shell Programming and Scripting

Script to check for a specific number of columns in a file

Hi All I have a file which has five columns in each rows. cat file.txt a|b|c|d|e 1|2|3|4|5 a1|a2|a3|a4|a5 . . . I need to make sure that there are no less than five or more than five columns (in all the rows) by mistake. I tried this : cat file.txt | awk 'BEGIN{FS="|"};{print... (3 Replies)
Discussion started by: chatwithsaurav
3 Replies

4. UNIX for Dummies Questions & Answers

Check group consistencies

hello masters , please help here. I have 4 cols, I am looking for consistent 'geno' values within 'line', 'part' combinations. If the geno values are not consistent within a 'line', 'part' block, then we delete that block. One of the complications is that geno values are always 2 character, but... (7 Replies)
Discussion started by: ritakadm
7 Replies

5. Shell Programming and Scripting

To check for a number inside the file in UNIX

Hi Gurus I am a newbie to Unix programming and I am having a difficulty in finding out a number which is present in a file and storing it in a variable so that i can use it in my shell script. The content of the file "count" is: Count of the files=11 I need to just store the value 11 in... (8 Replies)
Discussion started by: vikramgk9
8 Replies

6. Shell Programming and Scripting

need a one liner to grep a group info from /etc/group and use that result to search passwd file

/etc/group tiadm::345:mk789,po312,jo343,ju454,ko453,yx879,iy345,hn453 bin::2:root,daemon sys::3:root,bin,adm adm::4:root,daemon uucp::5:root /etc/passwd mk789:x:234:1::/export/home/dummy:/bin/sh po312:x:234:1::/export/home/dummy:/bin/sh ju454:x:234:1::/export/home/dummy:/bin/sh... (6 Replies)
Discussion started by: chidori
6 Replies

7. UNIX Desktop Questions & Answers

Need to ftp some files, and check the number of rows in the transferd file

1)I need to write a script which ftps 3 files to a unix box, 2)once the files are ftped i need to check the number of rows in each file and compare it with the data (no of rows) coming in a manifest file, if the number of rows in each file matches the data coming in manifest file, then i need to... (3 Replies)
Discussion started by: imran_affu
3 Replies

8. Shell Programming and Scripting

check number or character of a file

Hi, Please see the below information. 1. Read files one by one and run the script. 2. Check if the filename is CHARTER OR NUMBER 3. Run the case statement. I have files in the folder. i will get 300 files in a single day. Abc_111111111111.csv 101010_kkk_bbbb.csv... (6 Replies)
Discussion started by: onesuri
6 Replies

9. UNIX for Advanced & Expert Users

retrieving all group names with a given group number

hi, which Unix/C function can i use to retrieve all group names with a particular group id? The following C code prints out the group id number of a particular group name: ------------------------------------------------------------------------ #include <stdio.h> #include <grp.h> int... (3 Replies)
Discussion started by: Andrewkl
3 Replies

10. Shell Programming and Scripting

how to search string and number in one file and check in the other file

Hi, Can anyone help in the below problem. file1 has the below contents fileset 999 primary-ilist inode 37020 has invalid dotdot (426094) -> Not exist fileset 999 primary-ilist inode 115016 dup block ->... (9 Replies)
Discussion started by: knshree
9 Replies

Featured Tech Videos