Need help(sh script)--schell scripting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help(sh script)--schell scripting
# 1  
Old 03-10-2008
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 the same result by removing "=". and get only two lines as below one format.

Like
#################
Modified records are as follows
@owl.core.admin.jonas_user@ = value221
@owl.core.admin.pltf_name@ = valuee991
######################

Please do suggest me the way to achieve it using awk or sed or any command.

thanks in advance.
regards
shahid
# 2  
Old 03-10-2008
Assume you output is in a file forum1

Use the follwing commands

sed 's/=/''/g' forum1 > forum2

sed 's/@ =:/@/g' forum2 > forum3

You will get the desired results in file forum3
# 3  
Old 03-11-2008
Hi Anup ...thanks a lot for the reply.
This code sed 's/=/''/g' forum1 > forum2 works excellent to replace '=' in the whole file. But that is not my requirement . I hve to delete or remove those lines beginning with = and no more after that...I mean blank after "=" ...

Ex:

line no 1 =
line no 2 =
line no 3 bvdshb= bchjac(do not remove" = "here)
line no 4 cds lhvvc=hjbvsd(do not remove" = "here)

remove only line no 1 and 2.but not line no 3 , 4. Hope this ex is clear.

Thanks
ShahidSmilie
# 4  
Old 03-12-2008
MySQL thanks--schell scripting

This command works excellent to meet my requirement
######grep -v ^= filename###########

Regards

Shahid
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 prvenent giving password run time in schell scripting?

Hi I'm copying around 20 vi files from solaris server-A to server-B using 'scp' command.I have included all 20 scp commands in one shell script. Proplem is, while executing each scp command its prompting for my NIS password of server A. Please see below How to get rid of password prompt.??? (1 Reply)
Discussion started by: buzzme
1 Replies

2. Shell Programming and Scripting

Shell Scripting.... How to start a same script in 3 different logins?

Hi, I’ve a shell script. If I trigger the script it takes one day to complete the execution. I’ve to start the same script in 3 different logins of Unix machine simultaneously. Do you have any idea how can I make it? Please suggest. Thank you.. Stop making the font size smaller than... (3 Replies)
Discussion started by: testin
3 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

New to scripting. Help with backup script

Just learning how to script and am trying to create a script that will: *change ownership to nobody *change permissions to rw *tar the directory *back it up to a share *remove backups older than 14 days I will be doing this on a RHEL 5.3 box on my home network as... (2 Replies)
Discussion started by: daledavis67
2 Replies

5. UNIX for Dummies Questions & Answers

Bash scripting - Get script name

All, I am trying to migrate a script written in ksh (AIX) to bash (SuSE Linux). I encountered a number of errors when I am trying to run this script on bash and I was resolving them one-by-one. However, there is one error that remains. Here are the details: The script has the following command:... (9 Replies)
Discussion started by: vivekgadwal
9 Replies

6. Shell Programming and Scripting

Understanding of a script as a scripting newbie

Hi! I have the following script and do not understand part of it. I have a very little understanding of scripting. The script is for Nagios to check the response of fast-com.de. The guy who has written it is no longer in the company. #!/bin/sh PATH=/adm/bin:/bin:/usr/bin export PATH ... (2 Replies)
Discussion started by: locutus01
2 Replies

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

8. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: shahidbakshi
2 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