Sponsored Content
Top Forums Shell Programming and Scripting shell script to search a string and delete the content Post 302249235 by vic_mnnit on Tuesday 21st of October 2008 01:41:33 AM
Old 10-21-2008
Thanks Rubin for your response.
I've somehow arrived at a solution that is working for my requirement.

this is
sed "s/IPaddress .*/IPaddress $IP/g" my.cam>>my.cam.tmp && mv my.cam.tmp my.cam

& it searches the string 'IPaddress in the file my.cam from the existing script, deletes the contents after this string untill a new line starts and then appends the value of variable 'IP' in front of this string 'IPaddress'

this was the exact thing i wanted to achieve.

But,thanks for all your support.

Vikas
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to search content of file with timestamps in the directory

hello, i want to make a script to search the file contents in my home directory by a given date and output me the line that has the date... (10 Replies)
Discussion started by: psychobeauty
10 Replies

2. Shell Programming and Scripting

Delete content of file 1 in file 2 with shell script

OK, best is I explain what the operating enviroment is. Linux, but Motomagx. It is a Linux operated mobile phone, Motorola V8. I am writting a shell script, but got stuck. I have to delete the complete content of file 1 in file 2. I have attached the 2 files. You can see that the content of... (2 Replies)
Discussion started by: rasputin007
2 Replies

3. Shell Programming and Scripting

Search for string in filename, not file content

How can I search for a string in a filename? For example, I want to know if a filename (not the file contents) contains the string "test". (3 Replies)
Discussion started by: daflore
3 Replies

4. Shell Programming and Scripting

Need to build Shell Script to search content of a text file into a folder consist several files

Have to read one file say sourcefile containing several words and having another folder containing several files. Now read the first word of Sourcefile & search it into the folder consisting sevral files, and create another file with result. We hhave to pick the filename of the file in which... (3 Replies)
Discussion started by: mukesh.baranwal
3 Replies

5. Shell Programming and Scripting

Conditional search and delete using SED / Shell script

Hi, I want to perform a conditional search and remove my search string. Input string: "abcdaabcadgfaarstab" Character to search: "a" Condition: Remove all "a" in the input string except if it is "aa" Output string: "bcdaabcdgfaarstb" Can you please help me in this? (5 Replies)
Discussion started by: dominiclajs
5 Replies

6. Shell Programming and Scripting

UNIX shell script to search a string in a file

Hi folks, I am new for shell script, I hope somebody to help me to write shell script My requirement is below steps 1. I have apache access.log i.e located in /var/log/httpd/ Ex. 127.0.0.1 - - "GET... (14 Replies)
Discussion started by: Chenchireddy
14 Replies

7. UNIX for Dummies Questions & Answers

Search for a string,delete the line and replace with new string in a file

Hi Everyone, I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file. I am very new to unix. Kindly help... (10 Replies)
Discussion started by: Pradhikshan
10 Replies

8. Shell Programming and Scripting

Shell script to search all files for every string in another file

Hello All I have a pattern.txt file in source directory ((/project/source/) in linux server and data looks like: 123abc17 234cdf19 235ifg20 I have multiple log files in log directory (/project/log/) in linux server and data for one log file looks like: <?xml version="1.0" processid... (11 Replies)
Discussion started by: pred55
11 Replies

9. Shell Programming and Scripting

Linux shell script, search by an input string

So, there is a large file where I have to conduct several search using bash shell scripting. The file is like this: TITLE and AUTHOR ETEXT NO. Aspects of plant life; with special reference to the British flora, 56900 by Robert Lloyd... (1 Reply)
Discussion started by: Philia
1 Replies

10. Shell Programming and Scripting

How to Search a string in a file in shell script?

I have a text file which is generated when the batch job is run. This batch may take few mins to run. When completed, the last line of the text file would be process completed. I need a shell script which will wait for this file till the process completed is printed in it, once found, it would move... (2 Replies)
Discussion started by: Lalat
2 Replies
ISCSI_INITIATOR(4)					   BSD Kernel Interfaces Manual 					ISCSI_INITIATOR(4)

NAME
iscsi_initiator -- kernel driver for the iSCSI protocol SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file: device iscsi_initiator Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): iscsi_initiator_load="YES" DESCRIPTION
This driver, along with its userspace counterpart iscontrol(8), is obsolete. Users are advised to use iscsi(4) instead. The iscsi_initiator implements the kernel side of the Internet SCSI (iSCSI) network protocol standard, the user land companion is iscontrol(8), and permits access to remote virtual SCSI devices via cam(4). SYSCTL VARIABLES
debug.iscsi_initiator set the debug-level, 0 means no debugging, 9 for maximum. net.iscsi.isid the initiator part of the Session Identifier. kern.cam.cam_srch_hi=1 allow search above LUN 7 for SCSI3 and greater devices. the following are informative only: net.iscsi.driver_version the current version of the driver. net.iscsi.sessions the number of current active sessions. net.iscsi.n.targetname is the targe name of session n. net.iscsi.n.targeaddress is the IP address of the target of session n. net.iscsi.n.stats are some statistics for session n net.iscsi.n.pid is the process id of the userland side of session n, see iscontrol(8). FILES
The iscsi_initiator driver creates the following: /dev/iscsi used to create new sessions. /dev/iscsi%d for each new session. SEE ALSO
cam(4), camcontrol(8), iscontrol(8) STANDARDS
iSCSI RFC 3720 AUTHORS
This software was written by Daniel Braniss <danny@cs.huji.ac.il> BUGS
The lun discovery method is old-fashioned. BSD
October 9, 2014 BSD
All times are GMT -4. The time now is 02:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy