Re: Simple sed replacement tool
From: Kevin Collins (spamtotrash_at_toomuchfiction.com)
Date: 05/14/04
- Next message: Kevin Collins: "Re: [Slightly OT] - Socket Security"
- Previous message: Barry Margolin: "Re: [Slightly OT] - Socket Security"
- In reply to: Bob: "Re: Simple sed replacement tool"
- Next in thread: Ed Morton: "Re: Simple sed replacement tool"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 13 May 2004 23:50:40 GMT
In article <pan.2004.05.13.23.33.58.210051@dont.spam.me>, Bob wrote:
> On Thu, 13 May 2004 23:08:24 +0000, Kevin Collins wrote:
>
>
>>
>> Some people in this group seem to have knee-jerk reaction when Perl is
>> mentioned, but this is still the best thing since sliced bread if you have
>> perl (no shell script required):
>>
>> $ perl -pi -e 's/string1/string2/g' *
>>
>> Which does the substitution inline and doesn't require the user to deal
>> with redirecting or temp files... In addition, it can open you up to the
>> wonderful world of Perl one-liners, which can be just as useful (if not
>> more so) than any sed/awk/grep one-liners.
>>
>
> You are right. But, I often need to write scripts for small systems where
> bash is the most sophisticated tool available. Sometiems I even need to
> temporarily install my own statically linked bash.
Yep, its the old portability issue :) Some people are much more hard-core on
being portable and it IS good to know the alternatives for those times, but if
you know your environment then YOU are the best judge.
For example, in my environment, there are approximately 100 servers, with 90%
being HP-UX and the rest being RedHat Linux. If I write a shell script, its
written in ksh and using all of the ksh syntax and semantics because I don't
NEED to write it at a Bourne shell level - I have ksh88 on HP-UX and pdksh on
Linux, and I know (for the most part) the ways around the differences in the
utilities.
Now, if I were writing scripts for (say) a software vendor, where they had to
run on any platform, then I would write in strict Bourne shell style and be
militant about portability (like Chris F.A.J.!).
Kevin
ps - Chris, that is a compliment :)
- Next message: Kevin Collins: "Re: [Slightly OT] - Socket Security"
- Previous message: Barry Margolin: "Re: [Slightly OT] - Socket Security"
- In reply to: Bob: "Re: Simple sed replacement tool"
- Next in thread: Ed Morton: "Re: Simple sed replacement tool"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|