home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.shell:3727 comp.unix.questions:10599
- Newsgroups: comp.unix.shell,comp.unix.questions
- Path: sparky!uunet!munnari.oz.au!manuel!csc.canberra.edu.au!taiji.canberra.edu.au!kim
- From: Kim Holburn <kim@csc.canberra.edu.au>
- Subject: Re: Shell Scripts vs. C programs
- Message-ID: <1992Sep1.073956.27085@csc.canberra.edu.au>
- X-Xxmessage-Id: <A6C95F2ACB0105C3@taiji.canberra.edu.au>
- X-Xxdate: Tue, 1 Sep 92 01:55:54 GMT
- Sender: news@csc.canberra.edu.au
- Organization: University of Canberra
- X-Useragent: Nuntius v1.1.1d9
- References: <1992Aug31.211738.1909@tjhsst.vak12ed.edu> <la5rr9INNac3@almaak.usc.edu> <1992Sep1.044434.7193@news.acns.nwu.edu>
- Date: Tue, 1 Sep 92 07:39:56 GMT
- Lines: 37
-
- In article <1992Sep1.044434.7193@news.acns.nwu.edu> John Navarra,
- navarra@casbah.acns.nwu.edu writes:
- >>>I've heard that if at all possible, code a program as a shell script
- >>>rather than coding it in C. Can someone explain the rationale behind
- >>>this philosophy?
- >>
- >> BZZZ - shell scripts are non-portable
- >>
- > Huh? Why are shell scripts non-portable? Unless you are using
- >a non-standard shell, shell scripts are HIGHLY portable! Even if you
- >aren't using a non-standard shell, say [ba|k|z|]sh, it is highly
- portable.
- >For one, most [ba|k|z]sh scripts will run in sh and vice versa. And, if
- you
- >need to, you can always get shell X and compile it on your machine. This
- is
- >*usually* easier than rewriting C-code to accomodate your OS.
- >
-
- Not true. Having just had to port a set of programs that included C
- programs and bourne-shell scripts from sunOS 4.1.x to sequent Dynix/ptx
- (system V release 3.2). I can say that while the C took a day to port,
- the shell scripts have taken over a week with another week maybe 2
- likely. The C, because of conditional compilation is still a uniform set
- of source. The scripts have diverged fairly rapidly and are not
- interchangeable at all now.
-
- +----------------------------+-----------------------------------------+
- | Kim Holburn | Internet : kim@csc.canberra.edu.au |
- | Computer Services Centre | |
- | University of Canberra | Phone : (06)201 2203, (06)201 2401 |
- | PO Box 1 Belconnen | |
- | ACT Australia | Fax : (06)201 5074 |
- +----------------------------+-----------------------------------------+
- | born again and again and again and again and again buddhist |
- | well... in a previous life anyway :-) |
- +----------------------------------------------------------------------+
-