Re: how to fix a unix shell script to work on linux

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Darrin Chandler
Date:  
To: Main PLUG discussion list
Subject: Re: how to fix a unix shell script to work on linux
On Sat, Jan 12, 2008 at 07:09:16PM -0700, Josef Lowder wrote:
> .
> The following script used to work on my old unix system,
> to remove blank lines from a text file. It no longer works
> on linux, but now it gives an error message (below):
>
> sed '/[!-~]/!d' $1
>
>
> This is the error message:
>
> sed: -e expression #1, char 7: Invalid range end


I pasted it exactly as shown above and it worked flawlessly on my
OpenBSD system.

> How can I fix this?


I guess installing OpenBSD isn't the answer you're looking for... ;-)

As the other poster suggested, you can try something else. This may be
the same answer as he gave, but I can't be bothered to go look, but I
CAN be bothered to test it (and it works [again, on OpenBSD. try your
own system]):

sed '/^$/d' $1

-- 
Darrin Chandler            |  Phoenix BSD User Group  |  MetaBUG
   |  http://phxbug.org/      |  http://metabug.org/
http://www.stilyagin.com/  |  Daemons in the Desert   |  Global BUG Federation
---------------------------------------------------
PLUG-discuss mailing list - 
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss