Dynamic Attribute Changes


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Dynamic Attribute Changes
# 1  
Old 10-30-2006
Dynamic Attribute Changes

Hello ,

I am stuck out in a part of my script, though I am trying it through a script of loops but i emphasis on having a short code :


Input file has Attribute values changing with time

Date Monday October 30 10:22:56 IST 2006
object values references Date
Priya 157676 101 Oct 18 14:34
Ananya 157677 102 Oct 18 14:34
Rahul 157678 103 Oct 18 14:34
Neha 157679 104 Oct 18 14:34
Mrinal 157680 105 Oct 18 14:34
Pakash 157681 106 Oct 18 14:34
Chhavi 157682 107 Oct 18 14:34
Rita 157683 108 Oct 18 14:34
Tina 157684 109 Oct 18 14:34
Waqir 157685 109 Oct 18 14:34
Date Monday October 30 10:23:56 IST 2006
object values references Date
Priya 145020 101 Oct 18 14:34
Ananya 157677 102 Oct 18 14:34
Rahul 157678 103 Oct 18 14:34
Neha 157679 104 Oct 18 20:55
Mrinal 157680 105 Oct 18 14:34
Pakash 157681 124 Oct 18 14:34
Chhavi1 157682 107 Oct 18 14:34
Rita 157683 108 Oct 20 14:34
Tina 157684 109 Oct 18 14:34
Waqir 157685 109 Oct 18 14:34
Date Monday October 30 10:24:56 IST 2006
object values references Date
Priya 145687 101 Oct 18 14:34
Ananya 157677 102 Oct 11 14:34
Rahul 157678 104 Oct 18 14:34
Neha 157679 104 Oct 18 20:55
Mrinal 157680 105 Oct 18 14:34
Pakash 157681 106 Oct 18 14:34
Chhavi 157682 107 Oct 18 14:34
Rita 157683 108 Oct 18 14:34
Tina 157684 109 Oct 18 14:34
Waqir 157685 109 Oct 18 14:34

The Objects Changes the value/Refernces and date within a min
Thus the output file should conatins the list of objects whose parameters has changed

Output file
Date/Time Object Values Refernces Date
October 30 10:22:56 Priya 157676 101 Oct 18 14:34
October 30 10:23:56 Priya 145020 101 Oct 18 14:34
October 30 10:24:56 Priya 145687 101 Oct 18 14:34
October 30 10:22:56 Pakash 157681 106 Oct 18 14:34
October 30 10:23:56 Pakash 157681 124 Oct 18 14:34
October 30 10:24:56 Pakash 157681 106 Oct 18 14:34
October 30 10:22:56 Chhavi 157682 107 Oct 18 14:34
October 30 10:23:56 Chhavi1 157682 107 Oct 18 14:34
October 30 10:24:56 Chhavi 157682 107 Oct 18 14:34


Output file signifies that any change in object parameters should list what was the past object parameters, changed parameters and
new parameters after change .

I beleive its a really challenging taks which I am trying to sort out from past few days...
It would be really great if anyone could help me in This

KRegards,
Aparna
# 2  
Old 10-30-2006
Steps to be done.
------------------

1). First get the list of all the values for ex

Priya , Prakash etc into a file.

using

cat file_name | cut -d ' ' -f4-4 | sort -u > temp_file.

2). Then read each value using loop and grep and print the values in the order you want.

for i in `cat temp_file`
do
grep -i $i "from_file" > result_file.
done


I guess this way your problem can be solved.
# 3  
Old 10-30-2006
Problem still exists

Hello ,
Thanks for the reply . but the problem is not solved with this because what this crsipt will do is just grep the object and paste in the output file
However what i want is whenever there is any change in the parameters value then only it should print the output in the output file

Suggestions are still awaited

KRegards,
Aparna
# 4  
Old 10-30-2006
once you collect all these values into a file.


You can use AWK
to compare the values on the reqd column
and if the new value of date != old value of date then
you can print the old value else ignore.
# 5  
Old 10-30-2006
That is what is my point of concern!!!Awk doesnt takes variables values and comparison cannt be performed with varaible as number of times the sequence is repeated is unknown .... the parameters may be repeated after n sec for total m hrs ....

KRgs
Aps
# 6  
Old 10-30-2006
I think , this is what you are looking for

first, you have to copy i/p info to the file as file_name

Code:
grep -v "Date" file_name | grep -v "IST" | sort -u


you can use following command to compare variable for "awk" command

Code:
#!/bin/sh
#assign shell's $1 ti awk search variable

search=$1
awk '$1 ~ /'"$search"'/' acronyms



cheers

Last edited by srikanthus2002; 10-30-2006 at 02:19 AM..
# 7  
Old 10-30-2006
Yet not solved

Hello ,

Though i will b to pass the variable through this awk statement by question lies otherways how will i compare each parameter value for each existnace that is still unknown to me!!

Pls suggest

Aparna
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to change a PS attribute?

Hi, i want to list all system processes showing the attributes pid, user name, cpu consumption, and the difference between the resident memory and the swap memory needed to stock the process in case of suspending it. i have two questions, the resident memory is the attribute size i think,... (4 Replies)
Discussion started by: Eskizoide
4 Replies

2. Red Hat

(.) at the end of file attribute.

Hi Linux Experts, I am using RHEL 6.4, on checking I identified some files ends with the file attribute like dot (.) at the end. Whereas, I checked with the same level of other servers and I don't identify dot(.) at the end of file attribute. Why is it so? is there any meaning for it. ... (3 Replies)
Discussion started by: gsiva
3 Replies

3. UNIX for Dummies Questions & Answers

How to use xml_grep to get the value of an attribute?

I'm using xml_grep command to get the value of different tags in a xml-file. No i also need the value of an attribute in a tag. Can I use xml_grep for this? Does anybody know how? ex. : <Name xmlns:xsi="http://www.w3.org/2001/XMLinst" xsi:spaceSchema="Name_5879.xsd"> ... </Name> I... (1 Reply)
Discussion started by: pistach
1 Replies

4. Solaris

ldapclient can not modify attribute

Hello, We have one Solaris 10 machine which has three LDAP servers configured. We want to remove one of them. I tried below ldapclient command however no change is made. ---------------------------------------------------------------------- ldapclient mod -a "defaultServerList=10.149.9.20... (0 Replies)
Discussion started by: alfa_w
0 Replies

5. Solaris

Solaris Attribute Problems

When I modify the file attributes of files and run a ls -l to view the changes everything looks correct, however when I run the init 6 to reboot the server the file attributes devert back to the origininal read only permissions. Any help would be appreciated (2 Replies)
Discussion started by: jimcz2it
2 Replies

6. UNIX for Advanced & Expert Users

Sql dynamic table / dynamic inserts

I have a file that reads File (X.txt) Contents of record 1: rdrDESTINATION_ADDRESS (String) "91 971502573813" rdrDESTINATION_IMSI (String) "000000000000000" rdrORIGINATING_ADDRESS (String) "d0 movies" rdrORIGINATING_IMSI (String) "000000000000000" rdrTRAFFIC_EVENT_TIME... (0 Replies)
Discussion started by: magedfawzy
0 Replies

7. AIX

login attribute settign

Dears i need some assistance in implementing following scenario, as per audit observation we have restrict remote log in of specific users after official hours by clients, but the same user needs to be log in from LFT console round the clock(or any time after logout,because certain application... (1 Reply)
Discussion started by: m_raheelahmed
1 Replies

8. Red Hat

Password Attribute

Hello Friends , Where do i check the following settings in redhat ? 1. Minimum required number of characters in the password (passwordMinLength) 2. Minimum number of digit characters, meaning numbers between zero and nine (passwordMinDigits) 3. Minimum number of ASCII alphabetic... (2 Replies)
Discussion started by: avklinux
2 Replies

9. Programming

UNIX->C++ File attribute

Hi to all, I need in Microsoft C++ to IDENTIFY unix files which are LINKS. I use CFTPFILEFIND class. Thanks :-) .:rolleyes: (0 Replies)
Discussion started by: mizrachi
0 Replies

10. Linux

File attribute Help please

Could anyone help i have a question that i have a problem with for my home work it is, How do i change file permissions in a command line enviromet thanx (1 Reply)
Discussion started by: Cube3k
1 Replies
Login or Register to Ask a Question