Sponsored Content
Top Forums Shell Programming and Scripting Help required deleting specific lines from file Post 302887390 by rbatte1 on Friday 7th of February 2014 08:05:16 AM
Old 02-07-2014
A few questions in response:-
  • What have you tried so far?
  • Where are you stuck?
  • What OS and version are you using?
  • What tools would you like to work with?
Most importantly,
  • What have you tried so far?


Regards,
Robin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting specific lines in a file

I have a file which has some lines starting with a particular word. I would like to delete 5 lines before each such line containing that particular word. eg: line1 line2 line3 line4 line5 line6 "particular word"... I would like to delete line2-line6 and all such occurences in that... (4 Replies)
Discussion started by: ramu_1980
4 Replies

2. Shell Programming and Scripting

Shell deleting specific lines

Hi, I'am working under unix solaris I have a text file with set of lines, each set of lines (BLOCK) have three fixed lines : Between SECND line and THEND we have N lines, N differ from a block to another sample : i have to make a script wich delete each 3 fixed lines if N=0... (3 Replies)
Discussion started by: salbanito
3 Replies

3. Shell Programming and Scripting

deleting specific lines in a file

I want to delete all lines from a file (orig_file) that contain the regex values (bad_inv_list) I tried a for each loop with sed but it isn't working for file in `cat bad_inv_list`; do sed '/$file/d' orig_file > pared_down_file.1 mv pared_down_file.1 orig_file done I've added... (2 Replies)
Discussion started by: verge
2 Replies

4. Shell Programming and Scripting

Deleting specific lines in a file

Hello, I have a file like this one: 03-07-2011 sunz02 message1 03-07-2011 sunz02 message2 03-07-2011 sunz02 message3 01-07-2011 sunz02 message1 01-07-2011 sunz02 message2 01-07-2011 sunz02 ... (1 Reply)
Discussion started by: asanchez
1 Replies

5. Shell Programming and Scripting

deleting specific lines in a file

Hello, I have a file like: 26-07-2011 sunz02 message1 26-07-2011 sunz02 message2 26-07-2011 sunz02 message3 15-07-2011 sunz02 message1 15-07-2011 sunz02 message2 15-07-2011 sunz02 message3... (5 Replies)
Discussion started by: asanchez
5 Replies

6. Shell Programming and Scripting

Deleting specific lines in a file

Hello, I have a file filled with dates, such as: 04-08-2011 message 04-08-2011 message 03-08-2011 message 01-08-2011 message 31-07-2011 message 24-07-2011 message 15-07-2011 message 13-12-2008 message 26-11-2007 message And I want to delete those lines whose date is older than 10... (5 Replies)
Discussion started by: asanchez
5 Replies

7. UNIX for Dummies Questions & Answers

Deleting lines that contain a specific string from a space delimited text file?

Hi, I have a space delimited text file that looks like the following: 250 rs10000056 0.04 0.0888 4 189321617 250 rs10000062 0.05 0.0435 4 5254744 250 rs10000064 0.02 0.2403 4 127809621 250 rs10000068 0.01 NA 250 rs1000007 0.00 0.9531 2 237752054 250 rs10000081 0.03 0.1400 4 17348363... (5 Replies)
Discussion started by: evelibertine
5 Replies

8. Shell Programming and Scripting

Deleting lines in a fixed length file where there is a word at specific location

I have a big file having 100 K lines. I have to read each line and see at 356 character position whethere there is a word "W" in it. If it is their then don't delete the line otherwise delete it. There are two lines as one Header and one trailer which should remain same. Can somebody... (5 Replies)
Discussion started by: mohit kanoongo
5 Replies

9. Shell Programming and Scripting

Issue deleting all lines (having a specific string) in a file

I'm trying to create a script. There are 2 files - fileA.log & fileB.log fileA.log has the below data : aaaa cccc eeee fileB.log has the below data : cjahdskjah aaaa xyz jhaskjdhas bbbb abc ajdhjkh cccc abc cjahdskjah ... (7 Replies)
Discussion started by: Pandee
7 Replies

10. Shell Programming and Scripting

Deleting specific lines from text file via scripting

Hi, I'm trying to search for some number and from that line, i need to delete the 5th line exactly. Eg: Consider below as text file data: 10000 a b c d e . . . 10000 w q t (8 Replies)
Discussion started by: Gautham
8 Replies
RESCAN-SCSI-BUS.SH(8)					      System Manager's Manual					     RESCAN-SCSI-BUS.SH(8)

NAME
rescan-scsi-bus.sh - rescan the SCSI bus. SYNOPSIS
rescan-scsi-bus.sh [ -l ] [ -w ] [ -c ] [ -r ] [ host... ] DESCRIPTION
rescan-scsi-bus.sh is a program that is used to rescan the SCSI bus using the SCSI add-single-device feature of the Linux SCSI layer. OPTIONS
-l Activates scanning for LUNs 0 .. 7 (default: 0). -L NUM Activates scanning for LUNs 0 .. LUN (default: 0). --luns=LIST Scan only LUNs in LIST. -w Enables scanning for device IDs 0 .. 15 (default: 0 .. 7). --ids=LIST Scan only device IDs in LIST. -i, --issue-lip Issue a FibreChannel LIP reset (default: disabled). -r, --remove Enables removing of devices (default: disabled). --forceremove Remove and readd every device (dangerous). -c Enables scanning of channels 0 1 (default: 0). --channels=LIST Scan only channels in LIST. host, --hosts=LIST If host adapters are given, only these are scanned (default: all). --nooptscan Don't stop looking for LUNs if 0 is not found. --color Use coloured prefixes OLD/NEW/DEL. LIST is a comma separated list of single values and ranges (no spaces allowed), e.g. 0,2-3,8,10-15. AUTHOR
rescan-scsi-bus.sh was written by Kurt Garloff <garloff@suse.de>. COPYRIGHT
This program is free software. You can use it under the terms of the GNU GPL (General Public License) Version 2 (or any later version, at your option). Note, that the GNU GPL implies, that there is NO WARRANTY at all. Full text of the GPL can be found in /usr/share/common- licenses/GPL file. AVAILABILITY
rescan-scsi-bus.sh is available from http://www.garloff.de/kurt/linux/scsidev/ March 1998 RESCAN-SCSI-BUS.SH(8)
All times are GMT -4. The time now is 02:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy