help about user sorting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help about user sorting
# 1  
Old 11-14-2008
help about user sorting

Hi Folks,

I need help in script idea, i have 5 users and there home directories are

/home/user1
/home/user2
/home/user3
/home/user4
/home/user5
/home/user5

In each user there is a file xyz.txt and abcd.txt.

I have two objectives.

1. sort those user have xyz.txt and abcd.txt not exist.
2. sort those user have xyz.txt and abcd.txt exist but there own and group is differnet.

Thanks,
Bash
# 2  
Old 11-15-2008
Since you want to check ownership.. of user etc...
You would write a script using a loop (while or for, your choice...)
which would
Code:
 1)  load UID/GID
 2)  write to a file  the username (UID/GID) if files not found
         else
     #check UID/GID 
        if different 
           write to another file...
        fi
     fi

# 3  
Old 11-15-2008
Thanks for your suggestion, but if file is not there like abcd.txt or any file not there then script will not work properly what is your advice how i check if is there or not, can you shed a light on it pls.

Thanks,
Bash
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sorting

I do sort on the date and Time chronologically, how can I make the NIL to be below in the output Input file: KT NIL NIL ZK 02/09/2016 18:11 CD NIL NIL AS 02/09/2016 18:22 AB 02/08/2016 18:17 VA 02/09/2016 18:50 CX 02/09/2016 18:10 sort -b -k 2.9,2.10 -k 2.1,2.2 -k 2.4,2.5 -k... (3 Replies)
Discussion started by: aydj
3 Replies

2. Shell Programming and Scripting

Sorting

Hi, I've got two arrays 1 3 5 7 2 4 6 8 and i need to write a shell script to get the output 1 2 3 4 5 6 7 8 without using sort or bubble sort. (0 Replies)
Discussion started by: web2moha
0 Replies

3. Shell Programming and Scripting

Sorting user by last login an count

Experts need your help i need to create a script which will give count of users logged between yesterday and today (Or if run exacle 12:00AM midnight, it will give count of of users logged on that day here is how the data looks Pappu, Paul|22-Feb-201|0|30-Jun-201 Aloor,... (9 Replies)
Discussion started by: karghum
9 Replies

4. UNIX for Dummies Questions & Answers

Help sorting with du

Hi! As a part of a larger script I'm using the comand du -k to get the sizes of various directories, the output is printed like this: 1324 ./images/backup/2012 1333 ./images/backup 1400 ./images 22 ./video/backup 44 ./video 1450 . I'm trying to print it the other way around with... (2 Replies)
Discussion started by: Tralaraloro
2 Replies

5. Shell Programming and Scripting

sorting

Hi all, Does anyone can help me the following question? I would like to write an AWK script. In the following input file, each number in "start" is paired with numbers in column "end". No Start End A 22,222,33,22,1233,3232,44 555,333,222,55,1235,3235,66... (7 Replies)
Discussion started by: phoeberunner
7 Replies

6. Shell Programming and Scripting

Sorting

Let's say that I have a database that I call part ID. This database has the following grouping: Dart1=4 Dart2=8 Dart3=12 Fork1=68 Fork2=72 Fork3=64 Bike1=28 Bike2=24 Bike3=20 Car1=44 Car2=40 Car3=36 I want to write a program that would read this database and tell me when the... (19 Replies)
Discussion started by: Ernst
19 Replies

7. UNIX for Advanced & Expert Users

Determining if user is local-user in /etc/passwd or LDAP user

Besides doing some shell-script which loops through /etc/passwd, I was wondering if there was some command that would tell me, like an enhanced version of getent. The Operating system is Solaris 10 (recent-ish revision) using Sun DS for LDAP. (5 Replies)
Discussion started by: ckmehta
5 Replies

8. Shell Programming and Scripting

Sorting :

Hi .... iam having a file with 20,000 rows and 56 colums. Iam trying to sort a file ....for that iam using 'sort' command. If iam having 3 and 5 key colums etc ... as numerical this 'sort' command will work? what ihave to do ? sample example : E100|0|19940102|1|11111|E003... (3 Replies)
Discussion started by: satyam_sat
3 Replies

9. Programming

Sorting in C++..

Hi, I need to do a sorting of 2 arrays. One array contains the values of both integer and character and other array can be anything. For example: Array={'1L','2C','NULL','23L','11L','4C','10L','9C'} Array= {'01-02-13-1x','02-11-23-3s','00-12-13-5f','NULL','22k',} If any of these arrays... (6 Replies)
Discussion started by: ronix007
6 Replies
Login or Register to Ask a Question