need assistance ----SH schell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need assistance ----SH schell script
# 1  
Old 02-21-2008
MySQL need assistance ----SH schell script

Hello All,


I need to develop a script(SH]) to generate a comparison file between two files old and new file.The script takes in parameter the old file path and the new file path. And the script generates a file containing the comparison between the two files with this details:

- Keys added on the new file (key=value)
- Keys modified on the new file (key=value)
- Keys deleted on the new file (key=value)

key column is the 4th one and value column is the 6th one in the sample file.

Example:

old file: key1,value1 new file:key4,value3
key4,value4 key6,value6


output file: comparison file
------------------

1> keys added ----- key6,value6
2>deleted ---------- key1,value1
3> modified---------- key4,value3


I'm new to schell scripting field. request you to explain briefly along with the code. any sort of assistance would be appreciated.
Thanks in advance


Regards Shahid.Smilie
# 2  
Old 02-21-2008
You could get away with some of this in diff, depending on your actual data. There are a few sexy awk examples on globbing diff results.

I would take the output of diff into perl, but your married to "SH" for some reason whatever that is.
# 3  
Old 02-22-2008
Thanks a lot.Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need assistance in ksh script

requirement : I need to read a text file and find out which particular line has highest charcters on it using the shell script. I tried & was able to find out only for one line. I could not able to find out for the entire the line. sed -n '10 p' ctstest.sh | wc -w Please guide me... (5 Replies)
Discussion started by: ramkumar15
5 Replies

2. Shell Programming and Scripting

Dummy script assistance

Hi, I am new in ksh scripting and if anyone can help that would be great. I'm writing a script which will SSH to several machines and then would append a certain file from a NAS to the /etc/sudoers file the problem i am having is after the script connects to a certain server the commands are... (7 Replies)
Discussion started by: galuzan
7 Replies

3. Shell Programming and Scripting

Calling a servlet from schell script

Hi All, I have deployed a servlet on my server and the u r l is http:// localhost:9080/ ExampleApp / TestJackServlet This works fine when i launch this URL from the browser I am looking for shell script to hit the servlet or hit the URL without launching the browser session. I... (3 Replies)
Discussion started by: jack3698
3 Replies

4. Shell Programming and Scripting

script assistance with shift J

Hey all, I need some assistance. I'm writing a script to eject tapes from a tape library, but the library is not a queued system and can only eject 15 tapes at a time. I added paste -d : -s so that it goes through full_tapes and puts each media_id on one line separated by the :. Now I'm... (2 Replies)
Discussion started by: em23
2 Replies

5. Shell Programming and Scripting

Shell Script Assistance

I am looking for a shell script or command to automate a process of opening many files in a directory and changing a string of text. Example: I have a apache web server that uses virtual hosting. There are approximately 2300 vhost entries or files. So in the directory... (2 Replies)
Discussion started by: jaysunn
2 Replies

6. Shell Programming and Scripting

Capture Schell script error

I work on AIX 5.x. I have a script which does lot of processing & calls multiple child scripts. How do I capture the error of the parent script if it fails? Thanks Sumeet (3 Replies)
Discussion started by: sumeet
3 Replies

7. Shell Programming and Scripting

shell script assistance please

When I run this command (showstatus <username> <dbname>) in the prompt, the following will be displayed in the screen: 1. Show processes 2. Start process 3. Stop process 4. Go back to prompt Once i choose/type Option "1" (which is Show processes), it will display the list of processes... (5 Replies)
Discussion started by: xinoo
5 Replies

8. Shell Programming and Scripting

Need help(sh script)--schell scripting

Hello everybody. Result of my script is coming out to be as mentioned in the below format. Output:: Modified records are as follows = = @abc.core.admin.jonas_user@ = value221 @abccsd.core.admin.pltf_name@ = valuee991 = = ####################################### I need to get... (3 Replies)
Discussion started by: shahidbakshi
3 Replies

9. Shell Programming and Scripting

creating reports using shell schell script

please advise..very urgent. purpose of my script is that it should generate a report by running a sql script which is stored in a directory and pull the information from DB.script shld be in such a way that I just need to pass a parameter and it shld generate the report and store it in a... (1 Reply)
Discussion started by: complicated
1 Replies

10. Shell Programming and Scripting

writing schell scripts

I am very new to Unix. I need to write a script that will grep some files, etc. When I write the script, do I need to know what shell I am using? If so, how do I do that? (1 Reply)
Discussion started by: ssmiths001
1 Replies
Login or Register to Ask a Question