Sponsored Content
Top Forums Shell Programming and Scripting need assistance ----SH schell script Post 302169439 by shahidbakshi on Thursday 21st of February 2008 10:06:42 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
script(1)							   User Commands							 script(1)

NAME
script - make record of a terminal session SYNOPSIS
script [-a] [filename] DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript. See WARNINGS. The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends when the forked shell exits or when Control-d is typed. OPTIONS
The following option is supported: -a Appends the session record to filename, rather than overwriting it. NOTES
script places everything that appears on the screen in filename, including prompts. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a privileged user, that is, root. Be sure that typescript is not a link before running script. SunOS 5.10 30 Jan 2004 script(1)
All times are GMT -4. The time now is 04:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy