LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Recursively Remove Comments

[ILUG] Recursively Remove Comments

Conor Mac Aoidh conormacaoidh at gmail.com
Sun Aug 15 19:48:07 IST 2010


On Sun, Aug 15, 2010 at 7:34 PM, Brian Foster <blf at utvinternet.ie> wrote:

>  | Date: Sun, 15 Aug 2010 15:42:36 +0100
>  | From: Conor Mac Aoidh <conormacaoidh at gmail.com>
>   |
>  | Just noticed this morning an error with the command:
>  |
>   |    [...]  sed -i -e '/*/d' $file  [...]
>   |
>  | sed expects anything after the -i to be the extention given to all the
>  | backup files it makes.
>
>  No, it does not.  The suffix is _optional_.
>  That means the suffix, if specified, must be the
>  remainder of the -i argument.  In the above case,
>  there is nothing, so there is no suffix, so there
>  is (for GNU sed(1) on Linux) no backup.
>
>
Well I can assure you that it does make a backup on OS X... for example this
command:

sed -i -e '/*/d' index.php

will remove comments from index.php, and create a backup file called
index.php-e

--
Conor

http://blog.macaoidh.name


More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell