The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Search files between a date range zcanji Shell Programming and Scripting 7 05-27-2009 01:31 PM
How can i copy files by date last modifed range? geauxsaints UNIX for Advanced & Expert Users 4 05-25-2008 12:06 PM
how do I identify files with characters beyond a certain range. kcsunsun01dev Shell Programming and Scripting 3 02-14-2008 05:51 PM
cp only files in certain date range ee7klt UNIX for Dummies Questions & Answers 1 06-27-2005 10:35 PM
Moving Files within a particular date range rooh UNIX for Dummies Questions & Answers 3 03-18-2002 10:59 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-02-2009
gsiva gsiva is offline
Registered User
  
 

Join Date: Dec 2008
Location: coimbatore
Posts: 107
need to remove a range of files

How come I remove the range of file from update.0001* to update.0002* and not other files.
  #2 (permalink)  
Old 04-02-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,762
Code:
for file in update.0001* update.0002*
do
    rm -f $file
done
Warning - TEST this first to make sure you are getting the file you want -
Code:
for file in update.0001* update.0002*
do
    echo "This file is gone: $file"
done
  #3 (permalink)  
Old 04-02-2009
gsiva gsiva is offline
Registered User
  
 

Join Date: Dec 2008
Location: coimbatore
Posts: 107
Hi,

Thank you, that worked out...
  #4 (permalink)  
Old 04-03-2009
gsiva gsiva is offline
Registered User
  
 

Join Date: Dec 2008
Location: coimbatore
Posts: 107
i need to remove the line in a file, such as

<script language=javascript><!-- . . . .. . . . . .. .. . . .. .
</scripts>


I need to remove the link with the header starts with <script language ....</scripts> Also, this line has to be removed for the files with the extension of *.html ... Could you please help me on this...
  #5 (permalink)  
Old 04-03-2009
gsiva gsiva is offline
Registered User
  
 

Join Date: Dec 2008
Location: coimbatore
Posts: 107
hi,

Any help on my request, please....
  #6 (permalink)  
Old 04-04-2009
dennis.jacob dennis.jacob is offline Forum Advisor  
dj - the student
  
 

Join Date: Feb 2007
Location: Singapore/Bangalore/Cochin
Posts: 596
Quote:
Originally Posted by gsiva View Post
i need to remove the line in a file, such as

<script language=javascript><!-- . . . .. . . . . .. .. . . .. .
</scripts>


I need to remove the link with the header starts with <script language ....</scripts> Also, this line has to be removed for the files with the extension of *.html ... Could you please help me on this...
Try this:

Code:
sed  '/script language/,/scripts>/d'  filename
  #7 (permalink)  
Old 04-04-2009
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,538
Quote:
Originally Posted by jim mcnamara View Post
Code:
for file in update.0001* update.0002*
do
    rm -f $file
done
would this be easier?
Code:
rm -f update.0001* update.0002*
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0