|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Emergency UNIX and Linux Support !! Help Me!! Post your urgent questions here for highest visibility. Posting a new thread to this forum requires Bits. We monitor this forum to help people with emergencies, but we do not guarantee response time or answers. This forum is "best effort" only. Members who reply to posts here receive a bonus of 1000 Bits per reply. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
sed on Mac OS versus Linux
I'm trying to replace space with inderscore on Mac OS X 10.6.3
sed -i 's/ /_/g' somefile sed: 1: "hsa_mirbase.fa": extra characters at the end of h commandThis works perfectly fine on Linux. Thank you Joseph Dhahbi |
| Sponsored Links | |
|
|
|
#2
|
||||
|
||||
|
Hi. From the OSX man page for SED: Code:
-i extension Edit files in-place, saving backups with the specified extension. So, for example: Code:
sed -i.bak 's/ /_/g' somefile (I guess that the extension is optional on Linux, but may be provided (will check!)) (actually, without checking too much, according to the man page here, it is optional) (actually #2, the OSX man page is rubbish! It suggests that it is optional, but complains when it's not given) Code:
-i extension
Edit files in-place, saving backups with the specified extension. If a zero-length extension is given,
no backup will be saved. It is not recommended to give a zero-length extension when in-place editing
files, as you risk corruption or partial content in situations where disk space is exhausted, etc.Last edited by Scott; 06-07-2010 at 03:57 PM.. |
| The Following User Says Thank You to Scott For This Useful Post: | ||
jdhahbi (06-07-2010) | ||
| Sponsored Links | ||
|
|
|
#3
|
|||
|
|||
|
Thank you for your help
|
|
#4
|
|||
|
|||
|
SED on OS X is the BSD version (certainly is on OS X 10.6.4).
I have found that GNU versions of UNIX utilities often have far more options available to them, the danger is that if you know the extra options, you'll miss them on BSD based systems. Ben |
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Awk Versus Cut | jaysunn | Shell Programming and Scripting | 6 | 12-29-2009 09:36 AM |
| AIX versus Networks | rawatmohinder | AIX | 5 | 05-23-2006 05:54 AM |
| <LF> versus <CR>/<LF> | jerardfjay | Shell Programming and Scripting | 1 | 10-20-2005 06:09 PM |
| CTRL+H versus ^? versus BACKSPACE | alan | UNIX for Dummies Questions & Answers | 3 | 07-23-2003 01:08 PM |
|
|